Incorporating IF/OR/AND into LOD calulations in Tableau

Viewed 18

I need to find the minimum date for each person ID when the person met the following conditions: Job Name = XXX AND Type = 111 OR Type = 222 OR Type = 333

I tried the following, but it didn't quite work.

{FIXED [Person Id]: 
MIN(IF [Job Name] = “XXX” 
AND TYPE = "111"
OR TYPE = "222"
OR TYPE = "333"
THEN [Date])}
1 Answers

Every IF needs an END. Try something like this.

{FIXED [Person Id]: MIN(IF [Job Name] = "XXX" AND [TYPE] IN ("111", "222", "333")
THEN [Date] END)}
Related