Dear community,
May i know how can i interepret the formula below ?
IIF([HOUSEHOLD]="Y", [PACKAGE]= "100" or [PACKAGE] = "200", "NonHH")
normally i have the result of -1 and NonHH
and also formula below
IIF([PACKAGE]="100" or [PACKAGE] = "200", [REDEMPTION]>"2020-07-05 23:59:59" and [REDEMPTION] < "2022-10-01 00:00:00", "NonDevice")
I was trying to interpret this written and appreciate if someone can enlighten me on this.
Thank you,
Solved! Go to Solution.
Hi @SH_94 - Here is how it works:
In your scenario you put "OR" statement instead of X. That is why you get TRUE value instead of a meaningful result.
Hello @SH_94, is it possible for you to provide the sample input and output that you are looking for?
Thanks!
@SH_94 below is my interpretation
IIF([HOUSEHOLD]="Y", [PACKAGE]= "100" or [PACKAGE] = "200", "NonHH")
first it checks whether the HOUSEHOLD = 'Y' and If this is true then checks for PACKAGE in (100, 200), since the second condition returns only True or False that's why you are getting -1 or 0 else NonHH
Note: the statement [PACKAGE]= "100" or [PACKAGE] = "200" used as the True result of the first condition [HOUSEHOLD]="Y" as well as checking whether PACKAGE is in 100 or 200 which always returns True or False.
the same applies for the second formula
Both formulas you pasted are malformed IIF statements. You can't have "OR" / "AND" in the result part. You can only use them in the condition part (before the first comma).
IIF( [boolean condition], [result if TRUE], [result if FALSE] )