1 Reply Latest reply on May 30, 2017 6:43 AM by Zhouyi Zhang

    IF Function

    Dilyana Suleymanova

      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




      This is my formula

      If [Profit]>5000 then "Profit"

      ELSEIF [Profit]<4999 and [Profit]>1000 then "Breakeven"

      ELSE "Loss"



      But tableau givs me a wrong result:


      I can't find a mistake.

      Can smb help.


      Thank you!





        • 1. Re: IF Function
          Zhouyi Zhang

          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"



          and below is my result.



          Hope this could help

          Please let me know if you question.



          1 of 1 people found this helpful