HI guys,
I got stuck on IF function.
What I want to calculate is
If profit >5000 then "Profit"
elseif profit <4999 and profit >1000 then "Breakeven"
else loss
end
This is my formula
If [Profit]>5000 then "Profit"
ELSEIF [Profit]<4999 and [Profit]>1000 then "Breakeven"
ELSE "Loss"
END
But tableau givs me a wrong result:
I can't find a mistake.
Can smb help.
Thank you!
Regard!
Dilyana
Hi, Diyana
Since you are using aggregation in your Text, you should use the same aggregation in your code as well.
try this
If SUM([Profit])>5000 then "Profit"
ELSEIF SUM([Profit])<4999 and SUM([Profit])>1000 then "Breakeven"
ELSE "Loss"
END
and below is my result.
Hope this could help
Please let me know if you question.
ZZ