You are currently viewing Row Level Security in Tableau

Row Level Security in Tableau

Loading

Row level security in Tableau (RLS) is a feature that limits data access at a granular level, so that only specific parts of the data are available to particular users. This means that when multiple users access the same dataset, they only see the data they are allowed to see. RLS is particularly useful for maintaining data privacy, complying with data governance rules, and providing a customized user experience.

For example, in a global company with sales data, RLS can allow each regional manager to access only the data for their region. This keeps sensitive data secure and helps users focus on the information relevant to their work.

Importance of Row Level Security in Tableau

Data privacy and compliance– For sensitive information, RLS ensures data security by allowing users to see only what they are authorized to access.

Personalized data access– It gives each user access to only relevant data, making decision-making easier by filtering out unnecessary information.

Enhanced data security– By limiting data access, RLS reduces the risk of unauthorized access to critical data.

Scalable permission management– RLS is efficient for managing permissions across large datasets, especially for different departments, teams, or locations that require customized access.

When to use Row Level Security in Tableau

Multiple users access the same dashboard

Different users can view individual data without having to create separate dashboards.

Data privacy is a priority

Industries such as healthcare or finance benefit from RLS by restricting access to confidential data.

Role-based data access is needed

Specific roles such as regional managers or department heads see only their relevant data.

Dynamic user filtering

When user data needs to be filtered based on login credentials, RLS manages this requirement efficiently.

Ways to implement row level security in Tableau

User filters in Tableau

You can set user filters so that users can see only the data they are allowed to access. For example, sales representatives can apply a user filter to see only their regional data.

Using the security table

This table maps users to their permitted data access. You can join it with the main dataset to control data visibility based on roles. For example, each user’s ID is associated with their department, which restricts them to department-specific data.

Applying calculated fields

Calculated fields can define visibility rules. For example, you can create a calculated field that shows data only if the user’s region matches the data region.

Tableau Server or online (data source permissions)

Set up RLS at the data source level on Tableau Server or online, which enables centralized control of permissions based on user roles.

Use Case Of Row Level Security in Tableau

Scenario

An academic institution wants each department head to only see student data from their department.

Solution

With a security table that links each head to their department, RLS can restrict the data so that department heads can only see the performance of their students. This protects data privacy and makes access management easier.

Prerequisite:

Files: Students.csv, Departments.csv

Software: Browser (Chrome, Firefox etc.), Tableau

Web: https://online.tableau.com

Steps to perform above task by implementing RLS

Step 1: Open Browser (recommended: Chrome)

Step 2: Type URL as follows:

Step 3: Use your information for Sign In / Sign Up

Step 4: After Sign In, click on Users button

Step 5: You’ll get list of users in this section

Step 6: Click on Add Users and select Add Users by Username

Note: You can choose Import users from file , if you have list of users in a file

Step 7: select Tableau and Enter usernames, assign role and click on Add Users button

Step 8: After Adding Users, you can see list of users here

Step 9: Now, Open Tableau

Step 10: Click on Text file to connect with Tableau

Step 11: Browse csv file (Students.csv) and click on Open

Step 12: Data has been loaded, now click on Sheet 1

Step 13: Click on Data tab and select New Data Source to add one more data file

Step 14: Select Text file (because we have csv file)

Step 15: Browse csv file (Departments.csv) and click on Open

Step 16: Departments data has been loaded, now click on Sheet 1 for creating a visual then we can use it for RLS

Step 17: Drag Department from Students data pane and drop in Rows

Step 18: Click on dropdown with Automatic and select Pie

Step 19: Here, we got visual of Pie

Step 20: Drag-n-Drop Gender (from Students data pane) over Color (in Marks card) and Student Id (from Students data pane) over Angle (in Marks card)

Step 21: Right click on Student Id (in marks card) and select Measure for selecting Count

Step 22: Here, we can see that angle is defined by nos. of student and gender in different departments.

Step 23: Click on Server tab and select Sign In…

Step 24: Write server name Tableau Cloud or online.tableau.com and click on Connect button

Step 25: Enter your email in username and hit Sign In button

Step 26: Now Enter your Cloud URI that you get at the time of Sign Up

Note:

  • If you don’t remember URI, hit on Forget URI button and proceed

Step 27: Use you credential (email and password) and hit on Sign In button

Step 28: At the bottom, you can see your Full Name (means Signed In successfully)

Step 29: Click on Analysis tab and select Create Calculated Field… for creating field for RLS

Step 30: Specify a name (Login) for field and fill the following:

Step 31: Now, drag Login (from Students data pane) and drop in Filter shelf

Step 32: Mark on Null, False and Exclude

Step 33: Since we can’t see the visual because my email is not specified in the Departments table

Step 34: Click on Username (at the bottom of worksheet) and select any/particular

Output 1:

Note:

  • Here, I chosen to be HOD of History Department so that I can see distribution of male and female in History Department

Output 2:

Note:

  • Here, I chosen to be HOD of Chemistry Department so that I can see distribution of male and female in Chemistry Department

Conclusion

Row-level security is critical for organizations that require secure and granular data access. By enabling authorized users to view only specific data, RLS enhances data security and provides a customized user experience. By using user filters, security tables, calculated fields, or Tableau Server settings, businesses can efficiently manage data access while ensuring compliance with data policies. RLS not only protects sensitive data but also enables users to access meaningful information securely.

If you like the article and would like to support me, make sure to:

Leave a Reply