1 of 1 people found this helpful
Are you aware of what the USERNAME() function will provide you? The function - Returns the username for the current user. This is the Tableau Server or Tableau Online username when the user is signed in; otherwise it is the local or network username for the Tableau Desktop user.
You may find that the format/content of USERNAME is not what you expect - its worth testing that first
For example, mine returns my full email address not my login
Here are some other user related functions - these maybe helpful
Sorry for not been clear. by applying the following function USERNAME()=[emp_account] and dragging it to filter field and set values to 'TRUE' I got dynamic filtering by emp_account.
By applying IF USERNAME()=[emp_account] then [manager_account] END I wanted to substitute emp_account by manager_account. But I ended up with the very same result.
What I wanted Tableau to do is to dynamically filter by employee manager and enable an employee to see his peers data not only his own.
Hopefully, it became more apparent now.
perhaps for you are connected with your user you will get this information TRUE if you are employee and manager.
Where you get this information?
In my data source I have:
A) employee column (subordinate)
B) manager column (upper level to A)
C) measure column
Based on that I created worksheets/dashboards.
Then I created calculated field: USERNAME()=[emp_account] and drag it to filters on each sheet and set value to 'TRUE' and finally published it to tableau server.
Now each employee of group (A) observers his measure values (C), which is dynamically filtered based on username coming in.
Now I want dynamic filter to be based on employee's manager.
Process: An employee of group (A) got into the dashboard and sees data relevant to him and his peers (subordinates of his manager). all measure values related to subordinates of his manager.