-
1. Re: Matched Cohort - with "if" statement (can't use with boolean)
Andrew Watson Sep 20, 2016 11:16 AM (in response to . Berrett.Rice)1 of 1 people found this helpfulDoes this work? It hasn't been tested so the syntax maybe off. Effectively it's summing your FIXED fields to check for either 1, 2 or 3, grade dependent.
It returns True or NULL - effectively a boolean but not seen by tableau as boolean, seen as text.
IF [Current Grade] = 2 AND SUM({FIXED [State ID]: MAX(IIF([Year]=[Current Year] AND [Grade] = [Current Grade],1,0))}) = 1 THEN 'True'
ELSEIF [Current Grade] = 3 AND SUM({FIXED [State ID]: MAX(IIF([Year]=[Current Year] AND [Grade] = [Current Grade],1,0))} + {FIXED [State ID]: MAX(IIF([Year]=[Current Year]-1 AND [Grade] = [Current Grade]-1,1,0))}) = 2 THEN 'True'
ELSE SUM({FIXED [State ID]: MAX(IIF([Year]=[Current Year] AND [Grade] = [Current Grade],1,0))} + {FIXED [State ID]: MAX(IIF([Year]=[Current Year]-1 AND [Grade] = [Current Grade]-1,1,0))} + {FIXED [State ID]: MAX(IIF([Year]=[Current Year]-2 AND [Grade] = [Current Grade]-2,1,0))}) = 3 THEN 'True'
END
-
2. Re: Matched Cohort - with "if" statement (can't use with boolean)
Joe OppeltSep 22, 2016 8:04 AM (in response to Andrew Watson)
1 of 1 people found this helpfulTHis has been solved in this thread:
Make this LoD calculation NOT boolean
In essence, the solution there is the same as you offered here, Andrew.
I'm marking your answer as correct to close out this thread.