Row Level Security requires setup both in Tableau workbooks and in database.
To be secure and perform well, it is recommended to use a Live Connection to the database. Extracts may be too large if we join a security table that is one-to-many to the data table.
Lets consider the Excel Sheet that comes with Tableau-> Sample - Superstore Sales (Excel).
Consider Data is "Orders" worksheet .
Now lets say we want user to see the data pertaining to his own region.
For example User-A will see data for Nunavut
User-B will see data for User-B
Create a worksheet that has mapping for Region and respective User. (If we have RDBMS then we will have similar mapping table. )
Now open the workbook -> Pull the tables (or worksheets in this case); make a join betwenk Order and User Mapping.
Open the Worksheet we we want to create our report. Create a calculated column as shown in below screen-
Place the calculated column in the Filter and Select True.
Now when User-A logs in then he will see only data for Region Nunavut; and User-B will for Atlantic.
--=========================================================---
We can have following tables also as security tables -
Users Table
Roles Table
Users-Roles-Mapping Table
And then the Data Table (or Fact table will have the Roles instead on individual users) and that Role column can be joined to Users-Roles-Mapping Table.
--===================Row Level Security Based on Organization Hierarchy========
(Refer to workbook here->
https://public.tableau.com/profile/vikas.arora.bidw#!/vizhome/RegionalSalesProfit-RowLevelSecurityonHierarchy/Dashboard1
)
A more practical and real life scenario would be implementation of Row-Level Security based on Organizational Hierarchy where a boss can see all the data (records) created by himself or by his sub-ordinates.
Lets consider a scenario->
Les add a excel worksheet having following data (which is having employee details and their org path-
This will be kind of Employee table maintained by may in HR database. Notice the Org Path Desc the column that we will use for implementing security based on org hierarchy The column login ID is the one which LDAP Id.
Now lest see the a column Emp ID that has been added in Orders worksheet, this indicates the row created by the employee id.
As per the data in Empl ID- following is the mapping ->
Atlantic-> All records by Emp ID 1010 (Karen)
Northwest Territories-> All records by Emp ID 1010 (Karen)
Nunavut-> All records by Emp ID 1006 (varsha)
Ontario-> All records by Emp ID 1008 (monika)
Prarie -> All records by Emp ID 1008 (monika)
Quebec ->All records by Emp ID 1003 (vaurora)
West-> All records by Emp ID 1003 (vaurora)
Yukon->All records by Emp ID 1009 (david)
Lets see the workbook->
Create a Calculated Field -> RowBasedSecurityFilter
Place the field in Filter Shelf and select True.
So now the for different Regions appear based on the org hierarchy.