2 Replies Latest reply: Jul 20, 2016 4:58 AM by Gysbert Wassenaar RSS

    qlik sense previous month cannot work

    Z. LEUNG

      Hi,

       

      I just made a qlik sense app for comparing with the previous month data with variables (attached) but it doesn't work.

       

      the data set as following:

      Date No Amount (attached as book1)

       

      the measures formula as following:

      Sum({$<SYear={"$(vPriorMonthYear)"},SMonth={"$(vPriorMonth)"}>}Amount)

       

      are there any mistakes for the app?

       

      thanks

        • Re: qlik sense previous month cannot work
          Tresesco B

          Set analysis can't be used in this case. Because, set analysis doesn't return row-wise value but once for a chart. You could try something like:

           

          Above(Sum(Amount))

          • Re: qlik sense previous month cannot work
            Gysbert Wassenaar

            The set analysis expression calculates its set at the chart level, not the row level. So even if you change your variables by putting an = sign in front of the expressions, i.e.  =Month(addmonths(max(Date),-1)) instead of Month(addmonths(max(Date),-1)), then you will only get a result for june. If you want to see results for each month for the previous month then you'll have to use another trick. For example using an expression like sum(aggr(rangesum(above(total sum({<SMonth=>}Amount),1,1)),SMonth))