1
votes

I have a very specific question regarding achieving row level security in Tableau. I did the thorough reading of already available material on this topic 'How do I create multi level row level security in Tableau?', while my requirement is slightly different.

My sample data looks as below:

enter image description here

I want to make use of 'User' column in data to achieve row level security by placing a filter which is a calculated field as below:

enter image description here

I placed first 3 fields to rows and also calculated field to filter shelf and it gave the following options: TRUE, FALSE, NULL... when I chose 'TRUE' I could not find any records in the worksheet while choosing 'FALSE' gives all the records, so I am doubtful if my calculated field is working fine or not?

If I publish this workbook to tableau server giving access to John, Jess and Donald should they be able to view only the rows based on the filter?

Could someone confirm if I am in right direction? Thanks a lot in advance!

2
Whenever I do row-level security, I will enclose both the username() function and the column containing the user data in either upper or lower case. I have seen many situations where I assumed they matched but it turned out there was a problem with the case being different. - Sam M

2 Answers

1
votes

Note the calculated field: [user] = [USERNAME()]

1
votes

I tried replacing user name column with Employee ID and this worked straight forward to my calculated field CONTAINS('user', USERNAME()) as in my organisation the login to Tableau Server is via Employee ID

The advantage of encapsulating many usernames in a single cell will avoid duplicate rows that occur by joining main table with username table in a case where many users are entitled to more than one row of main table.