1 Reply Latest reply on Jul 8, 2015 1:33 AM by Shawn Wallwork

    Hi Experts

    Abdus Abdus

      Hi All,

       

       

      Please help me on this. Here is the logic iam trying to write in tableau. Fiscal year period is in parameter and its in dis format - 201301.

       

      if (right([fiscal year period]= 01 then i need to get the sum(revenue) from fiscal year period 201203 and 201204).

       

      iam trying to write this logic by using where function but tableau doesnt take the where function rite. Please help me .

       

       

      Thanks

        • 1. Re: Hi Experts
          Shawn Wallwork

          So for the first section you'll need either:

           

          RIGHT([fiscal year period],2)='01'

          or

          RIGHT(STR([fiscal year period]),2)='01'


          Depending on whether the parameter is a string or a number value. Assuming the field is a number the formula will be:


          IF RIGHT(STR([fiscal year period]),2)='01'

          AND [fiscal year period]<=201204

          AND [fiscal year period]>=201203

          THEN [revenue]

          END


          Then use SUM() as the aggregate when you put it into the viz.


          --Shawn