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.
- Create a Dataset from Multiple Files
- Create Role-Based Filters to Limit Data
What Do You Need?
- Access to Oracle Analytics
- Access to test users or perform the steps in Create User-Defined Application Roles and Assign Users; administration privileges required
- Access to the multi_file_dataset
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.
- Sign in to Oracle Analytics. On the Home page, hover over the multi_file_dataset, click Actions menu, and then click Open.
- In the dataset, click the Role-Based Dataset Filter toggle
.
- In the dataset, click Add Role
. From the Roles list, select Sales Rep or a role available in your environment.
- Click Add Filter
. In the Expression Filter, enter
Sa
in the Expression field. Select SALESREP_ID sales. Enter the equals symbol (=
), and then enterUSER()
.Your expression should look like
SALESREP_ID=USER()
. - Click Validate and then click Apply.
Description of the illustration salesrep_filter.png - In the dataset, click Add Role
. From the Roles list, select Sales VP or a role available in your environment.
- Click Add Filter
. In the Expression Filter, enter
VP
in the Expression field. Select VP_ID rephierarchy. Enter the equals symbol (=
), and then enterUSER()
.Your expression should look like
VP_ID=USER()
. - Click Validate and then click Apply.
Description of the illustration vp_filter.png - Click Add Role
. From the Roles list, select Senior Sales VP or the responsible role available in your environment.
- Click Add Filter
. In the Expression Filter, enter
1=1
, click Validate, and then click Apply. Click Save.
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.
- Click Go back
. On the Home page, hover over the multi_file_dataset, click the Actions menu
, and then select Inspect.
- In multi_file_dataset, click Access.
- On the Access page, click Roles. In the Add field, enter
S
, and select Sales Rep. - In the Add field, enter
S
, and select Sales VP. - 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 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.
- Sign out of Oracle Analytics. Sign in using the credentials of a Sales Rep.
- On the Home page, hover over the multi_file_dataset, click the Actions
, and then select Create Workbook.
- In the Data
panel, expand Sales.
- Hold down the Ctrl key, click SALESREP_ID and AMOUNT_SOLD, right-click select Pick Visualization, and then select Table
.
Description of the illustration salesrep_filtered_viz.png - Sign out of Oracle Analytics, and then sign in as a Sales VP user.
- On the Home page, hover over the multi_file_dataset, click the Actions
, and then select Create Workbook.
- In the Data
panel, expand Sales.
- Hold down the Ctrl key, click SALESREP_ID and AMOUNT_SOLD, right-click select Pick Visualization, and then select Table
.
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.
- Sign in to Oracle Analytics as the Senior Sales VP or the application role you defined with the 1=1 filter expression.
- On the Home page, hover over the multi_file_dataset, click Actions
, and then select Create Workbook.
- In the Data
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 the illustration sr_sales_vp_view.png - In the bar visualization, click Menu, select Edit, and then select Duplicate Visualization.
- In the second visualization, click Change Visualization Type
, and then select Table
.
- In the table visualization, click Menu
, select Sort By, and then select Custom. In Sort By, select AMOUNT_SOLD, select High to Low, and then click OK.
Description of the illustration sr_sales_vp_vizs.png
Learn More
Create Role-Based Filters to Limit Data in Oracle Analytics
F74669-03
March 2025
Learn how to create role-based filters in a dataset in Oracle Analytics.
This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.
If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, then the following notice is applicable:
U.S. GOVERNMENT END USERS: Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs) and Oracle computer documentation or other Oracle data delivered to or accessed by U.S. Government end users are "commercial computer software" or "commercial computer software documentation" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, reproduction, duplication, release, display, disclosure, modification, preparation of derivative works, and/or adaptation of i) Oracle programs (including any operating system, integrated software, any programs embedded, installed or activated on delivered hardware, and modifications of such programs), ii) Oracle computer documentation and/or iii) other Oracle data, is subject to the rights and limitations specified in the license contained in the applicable contract. The terms governing the U.S. Government's use of Oracle cloud services are defined by the applicable contract for such services. No other rights are granted to the U.S. Government.
This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
Intel and Intel Inside are trademarks or registered trademarks of Intel Corporation. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. AMD, Epyc, and the AMD logo are trademarks or registered trademarks of Advanced Micro Devices. UNIX is a registered trademark of The Open Group.
This software or hardware and documentation may provide access to or information about content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services unless otherwise set forth in an applicable agreement between you and Oracle. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services, except as set forth in an applicable agreement between you and Oracle.