Boost Your Tableau Security: The RLS Advantage
Data security is pivotal to any data structure, and Tableau makes it easy to ensure the right people see the right data through Row-Level Security (RLS). By restricting access to specific rows of data based on user roles or attributes, RLS ensures sensitive information remains secure.
Why Row-Level Security Matters
Imagine you’re managing a sales dashboard for a global organisation. Regional managers should only see data for their respective regions, and individual sales reps should only see their own data. Without RLS, everyone might have access to all the data, posing a risk to confidentiality and usability. RLS addresses this by tailoring data visibility based on user roles or attributes.
Setting Up Row-Level Security
There are a couple of ways to use RLS
1. Using ISMEMBEROF for Group-Based Security
2. Using USERNAME for User-Based Security
1. Using ISMEMBEROF for Group-Based Security
The ISMEMBEROF function is perfect for group-based security. For example, if your organisation uses Active Directory or Tableau Server groups, you can restrict data visibility based on group membership.
Example:
Within Tableau create a calculation, based on a Group called ‘Regional Managers’
ISMEMBEROF(‘Regional Managers’) THEN [Region]
ELSE NULL
In this example, only users in the “Regional Managers” group will see data for their assigned region. Users not in the group will see no data.
2. Using USERNAME for User-Based Security
The USERNAME function allows you to filter data for individual users based on their Tableau Server or Tableau Cloud username, connected to a security table.
Suppose you have a dataset, for example in a database or Excel with a column for usernames that maps data to specific users:
Example Security Table:
| Username | Region |
| alice@company.com | North |
| bob@company.com | South |
| Regional Managers | All |
You can use the following calculation to restrict data:
Create a calculation in Tableau:
IF [Username] = USERNAME() THEN [Region]
ELSE NULL
This ensures each user only sees the data associated with their username.
A security table is a scalable approach to manage RLS. This table maps users or groups to specific data access permissions.
You can join this table to your primary dataset in Tableau and use a calculated field to enforce the security rule, you need to ensure the primary dataset also has Username.
Applying Row-Level Security in Tableau
Once your rules are defined:
1. Connect Your Data: Import your dataset and security table into Tableau.
2. Join Your Security Table: Join the security table with your dataset on relevant keys, such as Username or Group.
3. Apply Filters: Create calculated fields using ISMEMBEROF or USERNAME and apply them as data source filters or worksheet filters.
Let me know your preferred option in the comments below. Or contact me if you would like any help in setting up your Row-Level Security in Tableau or within your data structure.
#data #tableau #dataset #security #rowlevelsecurity #database
Comments
LikeCommentShareComments settings
Add a comment…
Open Emoji Keyboard
No comments, yet.
Be the first to comment.Start the conversation
Share this content:
Leave a Reply