Example Two - Apply Multiple Role-Based Filters in a Workbook
This example shows how sales vice presidents and sales representatives use the same shared workbook to analyze sales data. Vice presidents can see the sales data for every sales representative in their team. Sales representatives can only see their own sales data.
Example report
Sales vice presidents or sales representatives can open the same shared workbook and see data appropriate to their application role and user ID.
- When a sales vice president logs into Oracle Analytics and opens the shared sales workbook, they see the sales data for each sales representative in their team. In this example, sales vice president dvauthoruser can see a sales summary for sales representatives in their team (bitechtest, bitechtest2, and bitechtest3).
- When a sales representative logs into Oracle Analytics and opens the shared sales workbook, they only see their own sales data. In this example, sales representative bitechtest2 can see his or her sales
$33,692.11
.
Example data
The example dataset contains sales data, with the sales representative ID in the SALESREP_ID
column.
Description of the illustration rbf_example_simple1.png
The sales vice president to sales representative hierarchy is implemented using a RepHierarchy table.
Description of the illustration rbf_example_complex2.png
The RepHierarchy table relates sales vice presidents to sales representatives in their team:
Example users and application roles
- Users dvauthoruser and dvauthoruser2 are assigned the application role Sales VP.
- Users bitechtest to bitechtest7 are assigned the application role Sales Rep.
Example dataset access configuration
In the Inspect dialog for the dataset, under Access, then Roles, authenticated users are given Read-Only access.
Description of the illustration rbf-example-3-share.png
Example role-based filters
- The workbook author applies a role-based filter to the sales vice president 'Sales VP' application role with the expression
SALESVP_ID = USER()
. The argument USER() is a system variable in Oracle Analytics that provides the ID of the logged-in user. - The workbook author also applies a role-based filter to the 'Sales Rep' application role with the expression
SALESREP_ID = USER()
.