5 Replies Latest reply on Sep 22, 2016 8:01 AM by . Berrett.Rice

# Make this LoD calculation NOT boolean

Is there any way to write an equivalent calculation to this:

... that isn't boolean? I'm running into a million (infuriating) problems because I can't use "if" calculations with boolean expressions.

The task is that I'm trying to build a matched cohort of students across three years. The expression (in combination with two others) works just fine. However I can't add any logic to it because Tableau won't allow "if" statements with boolean expressions.

Is there a workaround?

• ###### 1. Re: Make this LoD calculation NOT boolean

A simple thing you can do is:

IF ({FIXED [State ID]: MAX(IIF([Year]=[Current Year] AND [Grade] = [Current Grade],1,0))}=1) then 1 else 0 END

1 of 1 people found this helpful
• ###### 2. Re: Make this LoD calculation NOT boolean

IF {FIXED [State ID]: MAX(IIF([Year]=[Current Year] AND [Grade] = [Current Grade],1,0))} = 1 THEN ... ELSE ... END

Please upload a twbx if that doesn't work but works fine on a dummy workbook I have.

Also you have 2 threads going about the same thing, please close one of them or the mods will end up closing one for you as I'm aware they don't like it. Matched Cohort - with "if" statement (can't use with boolean)

• ###### 3. Re: Make this LoD calculation NOT boolean

This does seem to work! Thank you so much! Simple solutions are the best.

And I was advised to close a previous question I had - a slight variation of this same question - but I can't figure out how to close the previous question. I'll keep poking around to see if I can figure it out.

• ###### 4. Re: Make this LoD calculation NOT boolean

Paste the URL for it here.

I'm a moderator.  I can take care of it.