4 Replies Latest reply on Apr 27, 2018 10:17 AM by Deepak Rai

    IF/Then Function

    somayh.saleh.0

      Hi I am trying to build a function. Here is a table of mock data:

       

       

      Name
      X
      X2
      Bob1$40025%
      Bob2$0100%
      Bob3$050%
      Bob4$12575%
      Bob5$10080%

       

       

      The Logic I want to create:

       

      IF[x] = 0

      then

      [X2] = 100

      ELSE[X]

      END

       

      I want any 'X' value that is $0 to return 'X2' as 100%, and to keep the remaining 'X' value as is.

       

      however, the error i get is " Expected Type Boolean... "

       

      is there a way i can build this function on tableau? Any resources would be much appreciated.