Give a chestnut! Tableau Tips (101): Set user filters to view data by role

published: 2021-06-04

Tableau focuses on helping every user to see and understand the data, and discover problems from it, and encourage users to continue to explore and discover the data.

With the powerful Tableau Server, workbook sharing can be realized, so that everyone in the organization can view and share data. Different roles and positions in the organization are responsible for different regions and businesses. How to make the workbook only show the view within the user's business?

For example, for the following table of profit changes for each category of goods in each month in 2016. There are data for six regions in the figure. Is it possible to realize that when each region manager opens the view, he can only see the profit situation of his own region?

The answer is yes, we can do this by setting user filters.

In this issue of "Let's Give a Chestnut", Ada will share with you the Tableau trick: set user filters to view data by role.

To facilitate learning, Lizi uses Tableau's own supermarket data source.

Specific steps are as follows:

[Scenario 1] When you do not have an independent permission corresponding table, create a user filter directly.

1. Select "Server" → "Create User Filter" → "Region" in turn to open the "User Filter" dialog box.

2. Modify the name to "Regional Filter". Set in the window on the right according to the area that the regional manager is responsible for. Users who have already set a zone will have a "√" after their name.

3. Add the new "Regional Filter" set to the filter. After the setting is completed, a new set will be created in the set on the right side window. Add the newly created set to the filter and set "Add to Context".

4. Preview the user view. At the bottom right of the window, select a person to preview the user's view. For example, if you select "Fan Cai", the view will only display the 2016 profit data of Central and South China.

5. Edit the user filter. After creating a user filter, the system will create a new set, which means that the filter can be edited and changed by editing the set.

Right-click on "Region Filter" in the set and select Edit Set.

6. Publish the view with user filters. Select a user or a group in the drop-down list of "Generate thumbnails when users perform the following actions", and then click Publish. Users who have not set content will be blank on Tableau Server.

[Scenario 2] If there is a permission corresponding table, use the user list in the data source to filter.

In Chestnut, the "Salesperson" field in the data source is the user name in Tableau Server, and we can also create a filter based on the user name in the field.

1. First create a calculated field: determine the user name.

Tips: Here, you can also use the function USERNAME( ). The usage of these two functions is basically the same. One returns the user's full name and the other returns the user name, both of which are suitable for this scenario.

2. Add the newly created field to the filter, and select "True" in the filter settings.

3. Finally, complete the operation of publishing to the server.


Chestnut effect

For the above two cases of creating user filters, when we use the "Bai Dewei" account to view the report on the Tableau Server side, we will only see the data in the "Southwest" region.

Today’s Tableau tips, have you got it yet? Give it a try!