Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

qlik sense previous month cannot work

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

2 Replies
MVP
MVP

Re: qlik sense previous month cannot work

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

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))


talk is cheap, supply exceeds demand