Wouldn't it be great if you could design a dashboard for managers that was automatically filtered for just for them? You can do this with the USERNAME formula in Tableau. I will walk you through a use case where a manager can view their own employees progress. You can also combine these to formulas to create a landing page!
In order for this formula to work in this circumstance, you will need to have the Manager's ID in a column in your dataset. You will also need to have an employee ID column as shown below;
In the below visualization I created a Donut chart, which I rarely do, for the purpose of showing % complete. Donut charts, like Pie charts are not usually recommended as similar sized slices are hard to visually differentiate.
If you want to create this pie chart, I recommend watching this short YouTube video by Matthew Hefferon.
To create the USERNAME filter, all I do is right-click on the Manager ID column and enter the below formula;
Please note: I had to ensure my Manager ID column was formatted as a String in order for this to work.
Then I placed this formula onto the Filters shelf, I checked the box for True. The True box will only show when you are logged into a server and if you change the view from you to the manager.
Once you do this, the whole visualization will disappear, because you aren't the manager. That isn't your ID.
How do you do log into the workbook as the manager?
In the lower right-hand corner (all the way at the bottom of the Tableau application) you will notice your name appears. This will appear only when you are logged into a Tableau server. (It doesn't work for Tableau Public).
It's usually right here.
You have to click on this and change your name to the Manager's Name in the workbook. You can do this by searching for their ID or name, depending on how your server is set up. This is also how you test your workbook for different servers. You can switch to another user on the server to see how the workbook will appear for them. I highly recommend you test this in the Tableau Desktop application before you publish to the workbook to the server.
You can also use the ISMEMBEROF formula, which works in a similar fashion. Instead of using a person's ID it will be what server group (local or other) that they are in.
The details this may change for Tableau Cloud.
Comments