Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

rchiew604
New Contributor

Prior Month Data

The following syntax works when I extract amount more than 100,000 & smaller than -100,000, current year, current month:

num(sum({<Amount={">10000000<-10000000"},JDE.Year={"$(=year(today()))"},JDE.Month={"$(=month(today()))"}>}Amount/100),'#,##0')

However, I am having trouble extracting prior month by adding '-1':

num(sum({<Amount={">10000000<-10000000"},JDE.Year={"$(=year(today()))"},JDE.Month={"$(=month(today())-1)"}>}Amount/100),'#,##0')

No data returned.

Any idea what I did wrong?

3 Replies

Re: Prior Month Data

Try this

Num(Sum({<Amount = {">10000000<-10000000"}, JDE.Year = {"$(=Year(Today()))"}, JDE.Month = {"$(=Month(AddMonths(Today(), -1)))"}>} Amount/100), '#,##0')

rchiew604
New Contributor

Re: Prior Month Data

That totally works.

Thank you Sunny!!

Re: Prior Month Data

Super

Community Browser