Reputation: 1150
I am attempting to use Tableau to filter through some data, but I can't get the Tableau calculation right. I am trying to exclude employees where max = 1 and role = Supervisor or Manager. So, in theory, the only record that should show would be the Analyst record. I have a calculation I am using as a filter, but it of course doesn't work as desired. I'm relatively new to Tableau, so if there is a better way, I am open to it. Thanks in advance for your help.
Data set
| EMPLOYEE | ROLE | STATUS | STARTDATE | MAX |
|----------|------------|-------------|----------------------|-----|
| 12311 | Supervisor | Active | 2016-07-12T00:00:00Z | 1 |
| 12311 | Analyst | Not Active | 2015-06-11T00:00:00Z | 0 |
| 12311 | Help Desk | Not Active | 2014-05-12T00:00:00Z | 0 |
| 23432 | Manager | Active | 2012-11-02T00:00:00Z | 1 |
| 23432 | Associate | Not Active | 2011-04-23T00:00:00Z | 0 |
| 54332 | Analyst | Resigned | 2015-10-15T00:00:00Z | 1 |
What I have so far:
IF [MAX] = 1 AND [ROLE] = "MANAGER" OR [ROLE] = "SUPERVISOR"
THEN 1
ELSE 0
END
Upvotes: 0
Views: 35
Reputation: 7707
Strings are case Sensitive, so you have to use the exact same string in your calculation.If you have a leading space in the data, you have to add it as well or trim the field.It is also better to add brackets to prevent ambiguity.
Upvotes: 1