I am getting error on the below formula. Please help.
IF[Age]>=180,IF([Age],365,IF(ABS([Amount in local cur.])<250000,[Amount in local cur.],0),0),)
Thanks!
Solved! Go to Solution.
Hi @hbland2 — The way you have written IF...ELSE... ENDIF is not Alteryx's style.
Try to write like below:
IF condition1 THEN
true1
ELSEIF condition2 THEN
true2
ELSEIF condition3 THEN
true3
ELSE
false
ENDIF
or let us know if you need more help.
Need more help please @vizAlter
Hello @hbland2 ,
not sure what the logic is but if you want to use IIF then this may help. the below is syntactically correct but the logic needs checking.
IIF([Age]>=180,IIF([Age]=365,IIF(ABS([Amount in local cur.])<250000,[Amount in local cur.],0),0),0)
This logic is as follows
If age >=180, then another check on the age
IF age = 360 Then another check on the amount
If amount <250000 then amount else 0
This formula says if the age is greater than 180 days and the value is less than $250k then return the value in Amount in local Currency. If the age is less than 180 days or greater than 365 days, then return 0
@hbland2 — Either use IF... ELSEIF... ELSE... END statements, or use IIF( ) statements.
@hbland2 — Hope this helps:
IF [Age]>180 AND [Amount in local cur.] < 250000 THEN
[Amount in local cur.]
ELSEIF [Age]>365 OR [Age]<180 THEN
0
ELSE
Null()
ENDIF
Or write 0 instead of Null(), like below:
IF [Age]>180 AND [Amount in local cur.] < 250000 THEN
[Amount in local cur.]
ELSEIF [Age]>365 OR [Age]<180 THEN
0
ELSE
0
ENDIF
Hello @hbland2 ,
you can this as a logic.
IIF ([Age]>180 and [Age] <=365 and ABS([Amount in local cur.])<250000, [Amount in local cur.],0)
Hope it helps