10 Replies Latest reply: Jul 29, 2018 1:45 AM by Andy Manuja RSS

    Rolling based last three months average sale

    Andy Manuja

      Hi,

       

      I want to calculate the last three month's (if the current month is "June" the last three months should be March, April & May) average sales.

      Please find the below table for the data set.

       

         

      Sales
      Prod_IDProd_NameJanuaryFebruaryMarchAprilMayJune
      P100A100120110112130120
      P101B506045304250
      P102C115130125120110130
      P104D200220230200190210
      P105E606575486055
      P106G105120125130110140
      P107H909511085120100

       

      I simply loaded the data in to Qlik View and thought of using a measure to calculate the average sales of the last three months and adding it as a new column, however, I am finding it bit tricky at the moment.

       

      I am wondering whether I can use the "rangeavg" function to fulfill my said requirement?

       

      Appreciate if someone could help me with this issue.

       

      Thanks a lot in advance.

       

      Kind regards,

       

      Andy