3 Replies Latest reply on Nov 24, 2017 3:59 AM by Abdul Rahman

    Show Last Year Value based on Year and Month Parameter value

    Tri Susanti

      Hi All,


      I have 2 parameter : year and month (separately). I want to show historical data, in ex. I use Sample Superstore datasource. I want to show month of year based on year parameter and month parameter. If I chose 2017 and august, then month(order date) will be show from jan 2017 to august 2017. For this, I create calculated field like this :


      Month to Show calc field :

      IF YEAR(order date) = year_param

      and (month_param - month(order date)) < month_param

      and (month_param - month(order date)) >= 0 then Orderdate End

      I put this to filter to exclude the Null value. This syntax is working. The month of order date show based on month_param as the max month.


      And I want to countd(custID) to know how much customer for each month, I create calc field with this formula :

           # cust each months :

      COUNTD(IF year(order_date) = year_param then custID end)

      this calc work to calculate # of cust for each month. But when I try to show the last year value with this calc field :

      COUNTD(IF year(order_date) = year_param-1 then custID end)

      it always show 0 value.


      Please help how to solve this.


      Many thanks!