12 Replies Latest reply on Oct 19, 2017 7:58 AM by mohsin.khan.1

    How does if-elseif condition works on tableau

    Prakhar shrivastava

      My case like:

       

      IF [total  sales] > 2000 and [total  sales] <= 3000 then [total  sales] * 0.025

      ELSEIF  [total  sales] > 3000 and [total  sales] <= 4000 then [total  sales] * 0.03

      ELSEIF  [total  sales] > 4000  and [total  sales] <= 80000 then [total  sales] * 0.035

      ELSEIF  [total  sales] > 80000  and [total  sales] <= 100000 then [total  sales] * 0.04

      ELSEIF  [total  sales] > 100000  and [total  sales] <= 120000 then [total  sales] * 0.045

      ELSEIF  [total  sales] > 120000 THEN [total  sales] * 0.05

      ELSE  0 END

       

      Its always satisfy first condition or else condition. why this case not satisfy other conditions?