0
votes

How do I filter the Sales Revenue by SalesRep so that each SalesRep should be able to see only the sales volume generated by them using the username() function.

Let's assume John generated $2000 revenue, Jena generated $3000 and Eric generated $5000. Total sales volume combined for all 3 SalesRep is $10000. Employee ID of John is 101, Eric is 102, Jena is 103. I'm the manager and my employee ID is 104. I want to use the username() function in Tableau to filter the data in a such a way that John should see only revenue generated by him i.e. $2000 and he should be able to see the revenue generated by Jena in the bar chart. Similarly, Eric and Jena should be able to check their respective sales revenue. However, I should have the access to the revenue of all 3 as I'm their manager. How do I implement it in Tableau using the USERNAME() function.

1

1 Answers

0
votes

One possible solution could be with the help of ISUSERNAME():

Let's say SalesRep is an existing dimension in the datasource which has sales representative's full name or username or empid (Note: In below illustration I am considering that it has username e.g. John, Eric etc. For other options refer here).

  • Create a calculated field SalesUsersList as below (here list down ALL members entry):

IF ISUSERNAME("John_Tableu_Username") THEN "John" 
ELSEIF ISUSERNAME("Eric_Tableu_Username") THEN "Eric" 
ELSEIF ISUSERNAME("Jena_Tableu_Username") THEN "Jena" 
ELSEIF ISUSERNAME("Manager_Tableu_Username") THEN "Manager_Username" 
END
  • Create a calculated field LimitedAccessUsers as below (here list down ALL sales team's members entry who will have limited access):

([SalesUsersList]="John") or ([SalesUsersList]="Eric") or ([SalesUsersList]="Jena")
  • Create a calculated field hasLimitedAccess as below. Drag it to 'Filters' section and select True

NOT[LimitedAccessUsers] OR ([SalesUsersList]=[SalesRep])



Don't forget to let us know in case it solved your problem :)