Before you Begin

This tutorial shows you how to create role-based filters in a dataset. You can test the filters by creating an Oracle Analytics workbook using the selected user-defined application roles.

Background

As a content author, you can create filters based on Oracle Analytics and user defined application roles. The role-based filters limit what individuals in those specific application roles can see and do in workbooks. You might want to create role-based filters that enable Senior Sales Vice Presidents to see all enterprise sales data, and limit Sales Representatives to only see their sales data. You can limit Sales Vice Presidents to seeing the only the sales related to their assigned Sales Representatives.

When creating role-based filters, the roles must exist and the roles must have at least one expression filter defined for the selected role. To create the application roles used in this tutorial, you must have administrator privileges.

This is the second tutorial in the series Create Role-Based Filters.

What Do You Need?

Add and Define Role-based Filters

In this section, you create three role-based filters using the Sales Rep, Sales VP, and Senior Sales VP user-defined application roles. The Sales Rep and Sales VP application role filters use the USER() system variable to get the ID of the user signed into the Oracle Analytics.

The Senior Sales Vice President needs to see all data. You create a dummy filter using 1=1 as the filter expression to enable the Senior Sales VP's ability to see all the data.

  1. Sign in to Oracle Analytics. On the Home page, hover over the multi_file_dataset, click Actions menu, and then click Open.
  2. In the dataset, click the Role-Based Dataset Filter toggle Role-based dataset filter toggle.
  3. In the dataset, click Add Role Add role icon. From the Roles list, select Sales Rep or a role available in your environment.
  4. Click Add Filter Add role or filter icon. In the Expression Filter, enter Sa in the Expression field. Select SALESREP_ID sales. Enter the equals symbol (=), and then enter USER().

    Your expression should look like SALESREP_ID=USER().

  5. Click Validate and then click Apply.


    Description of salesrep_filter.png follows
    Description of the illustration salesrep_filter.png
  6. In the dataset, click Add Role Add role icon. From the Roles list, select Sales VP or a role available in your environment.
  7. Click Add Filter Add role or filter icon. In the Expression Filter, enter VP in the Expression field. Select VP_ID rephierarchy. Enter the equals symbol (=), and then enter USER().

    Your expression should look like VP_ID=USER().

  8. Click Validate and then click Apply.


    Description of vp_filter.png follows
    Description of the illustration vp_filter.png
  9. Click Add Role Add role icon. From the Roles list, select Senior Sales VP or the responsible role available in your environment.
  10. Click Add Filter Add role or filter icon. In the Expression Filter, enter 1=1, click Validate, and then click Apply. Click Save Save icon.


    Description of app_roles_exp.png follows
    Description of the illustration app_roles_exp.png

Provide Access to the Application Roles

In this section, you specify read-only access to the application roles.

  1. Click Go back Go back icon. On the Home page, hover over the multi_file_dataset, click the Actions menu Actions menu icon, and then select Inspect.
  2. In multi_file_dataset, click Access.
  3. On the Access page, click Roles. In the Add field, enter S, and select Sales Rep.
  4. In the Add field, enter S, and select Sales VP.
  5. In the Add field, enter S, and select Senior Sales VP, and then click Save. Close the multi_file_dataset inspect dialog.


    The Sales Reps, Sales VPs, and Senior Sales VP have read-only access to the multi_file_dataset and can create workbooks.

    Description of sales_access.png follows
    Description of the illustration sales_access.png

Test the Role-Based Filters

In this section, you sign in as a member of the Sales Rep or Sales VP application roles to verify that the sales data is limited by the application role.

  1. Sign out of Oracle Analytics. Sign in using the credentials of a Sales Rep.
  2. On the Home page, hover over the multi_file_dataset, click the Actions Actions menu icon, and then select Create Workbook.
  3. In the Data Data panel icon panel, expand Sales.
  4. Hold down the Ctrl key, click SALESREP_ID and AMOUNT_SOLD, right-click select Pick Visualization, and then select Table Table visualization icon.


    Description of salesrep_filtered_viz.png follows
    Description of the illustration salesrep_filtered_viz.png
  5. Sign out of Oracle Analytics, and then sign in as a Sales VP user.
  6. On the Home page, hover over the multi_file_dataset, click the Actions Actions menu icon, and then select Create Workbook.
  7. In the Data Data panel icon panel, expand Sales.
  8. Hold down the Ctrl key, click SALESREP_ID and AMOUNT_SOLD, right-click select Pick Visualization, and then select Table Table visualization icon.


    Description of vp_salesreps_amt.png follows
    Description of the illustration vp_salesreps_amt.png

Test the See All Application Role

In this section, you test the application role that can see all of the data. The Senior Sales VP can see all of the sales data in the dataset.

  1. Sign in to Oracle Analytics as the Senior Sales VP or the application role you defined with the 1=1 filter expression.
  2. On the Home page, hover over the multi_file_dataset, click Actions Actions menu icon, and then select Create Workbook.
  3. In the Data Data panel icon panel, expand Sales, hold down the Ctrl key, select SALESREP_ID and AMOUNT_SOLD, and drag the data elements to the canvas.


    Oracle Analytics selects the best visualization for the data elements.

    Description of sr_sales_vp_view.png follows
    Description of the illustration sr_sales_vp_view.png
  4. In the bar visualization, click Menu, select Edit, and then select Duplicate Visualization.
  5. In the second visualization, click Change Visualization Type Change vis type icon, and then select Table  table icon.
  6. In the table visualization, click Menu Menu icon, select Sort By, and then select Custom. In Sort By, select AMOUNT_SOLD, select High to Low, and then click OK.


    Description of sr_sales_vp_vizs.png follows
    Description of the illustration sr_sales_vp_vizs.png

Learn More