November 23, 2021

How to Set Up Row Level Security

 
This post describes how to set up row level security in Tableau workbook in order to restrict user access.  The result is when users access the workbook, they can only see data within their specific hierarchical groups.

 

Business Scenario:  At the front line of the business operation are the operators who take the phone calls from the users.  The calls are entered into a computer system and recorded as incidents.

 

The structure of the organization has the operators as the individual contributors. 

Managing the operators are the managers, which is the next level up.

Then, managing the managers are the directors.

Finally, managing the directors is the vice-president.

 

Business Requirement:  Set up a Tableau workbook with incident data to have access restricted by employee hierarchy.  Managers can only see data of their operators;  Directors, only their managers and operators; and Vice-president, all data.

 

Procedure:

 

1)   Create a user hierarchy table that has the operator name, sys_id, username, and a username_concat column that contains all the usernames of the operator’s manager and director who roll up to the vice-president’s organization.

 

The user hierarchy table should be created from an employee table that has the employee name and the employee’s manager, using self-join.

 

Note that it’s better to concatenate the usernames instead of the full names of the managers because multiple employees can have the same full name, but each employee has a unique username.  For example, a company can have three employees with the same name John Smith, but each of these employees should have a unique username.  Using unique username will avoid confusion and data duplication.

 


 

In this sample user_hierarchy table, John Smith has Pearl Buck as the manager, Ernest Hemmingway as the director, and Jane Austen as the vice-president.

 

 

2)   In Tableau workbook, the data source should link the incident table to the user_hierarchy table based on the operator’s sys_id.  Since each incident is assigned to and worked on by the operator, the query below will result in each incident having a username_concat column.

 

        SELECT a.*,

        b.username_concat

        FROM schema.incident_table a

        LEFT JOIN schema.user_hierarchy b ON a.operator_sysid = b.sys_id

 

 

3)   If you have people who don’t work directly with the operators but are allowed to see all data (bypass group), create a formula in Tableau workbook to add their usernames to the username_concat column.  Note that this step is optional if you don’t have a ‘bypass group’. 

 

        @username_concat + bypass

        [username_concat] + ' ' +

        'tam.nguyen alice.walker'

 

   

4)   Create another formula to verify that the username of the person who accesses the Tableau workbook is included in the formula @username_concat + bypass.

 

        @Is username_concat + bypass?

        CONTAINS([username_concat + bypass],USERNAME())

 

 

5)   Finally, apply this user filter to the worksheets and select ‘True’ to restrict access and to allow the managers to see only data of their operators.

 

 

August 14, 2021

Set Alerts When Control Limits Are Not Constant


This post describes how to set alerts when the control limits are not constant.

 

In the viz above, we want to set alerts when the moving average line (grey line) is above Upper Control Limit or below the Lower Control Limit (red lines).  The challenge is the control limit lines are not constant but changing by the day.

 

The work-around solution is to create another worksheet ‘Alerts’, write a calculated field, and add it to the dashboard.

 

@Alert

If ([Moving Avg] > [UCL] OR [Moving Avg] < [LCL]) THEN 1 else 0 end

 

Then set alerts on the y-axis of the Alerts worksheet when @Alert = 1.

 

June 14, 2021

Superstore

 

The Superstore data set has probably been visualized thousands of time.  Here's my version to one of the great data sets!


May 1, 2021

Error When Activate Tableau Desktop License

 

UPDATE (8/29/2023):

 

Apparently, the solution to this issue is much simpler.  As described here, you don't need to uninstall Tableau Desktop and re-install it.  You need only to do step 5d below (to delete the 3 Tableau files in the FLEXNet Publisher/FLEXNet directory).


--------------------------------------------------------------------------------------------------------------

 

ORIGINAL POST (5/1/2021):


When activating Tableau Desktop license with a valid product key, you get an error like ‘No License found for Tableau Desktop’ or ‘There was an unexpected error while trying to repair Trusted Storage’.

 

The resolution is to uninstall Tableau Desktop from your computer and re-install it.  This KB article provides the instruction on how to completely remove Tableau Desktop, however, the instruction is incomplete.  

 

For Mac, step 5 in the KB article should be:

 

5.  Some folders are hidden on Mac, to navigate to the hidden folders:

 

                a)  Hit Cmd + Space to launch Terminal on Mac.

 

                b)  In dialog box, type in /Library/Preferences (not ~/Library/Preferences).

 

                c)  Follow steps 3 and 4 in the KB article to delete the ‘com.tableau’ files.

 

                d)  In addition, delete the 3 Tableau files in the FLEXNet Publisher/FLEXNet directory.

 


 

Then restart your Mac and re-install Tableau Desktop.  

 

In Tableau Desktop 2019.3 and later versions, FLEXNet package is automatically installed when you install Tableau Desktop.  But in a rare occasion when you don’t see FLEXNet folders, you can manually install it.