Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rchiew604
Contributor
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
sunny_talwar

Try this

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

rchiew604
Contributor
Contributor
Author

That totally works.

Thank you Sunny!!

sunny_talwar

Super