4 Replies Latest reply on Nov 7, 2017 7:08 AM by Juan Manuel Ferreira

    How to return sales from fiscal year?

    Juan Manuel Ferreira

      Hi how are you?

       

      I have some questions about Tableau and how to return the fiscal years sales, for example.

       

      When I want to return the sales for the actual year, for example, I usually create a calculated field that contains something like this: "if year([date]) = year(today()) then sales else NULL end" and it works only when I perform in to a normal year, but in the fiscal year, I have to limit some month for one year and some month for the next year.

       

      For example, I want to return the sales for the last fiscal year, I usually create a calculated field like this:

      "IF (MONTH([Date]) = 1 OR MONTH([Date]) = 2 OR MONTH([Date]) = 1 OR MONTH([Date]) = 2) THEN

          IF

              (YEAR([Date]) = YEAR(TODAY()) - 1 AND

              MONTH([Date]) > 4) or

              (year([Date]) = year(today()-2) AND

              MONTH([Date]) <= 4)

        THEN [Sales]

        ELSE NULL

      END

      ELSEIF 

              (YEAR([Date]) = YEAR(TODAY()) - 1 AND

              MONTH([Date]) > 4) or

              (year([Date]) = year(today()) AND

              MONTH([Date]) <= 4)

        THEN [Sales]

        ELSE NULL

      END"

       

      But I now sure if in the limit Dates, like January it will work.. And I want a similar formula that can return the actual fiscal year sales.

       

      Many thanks,

      See you.