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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
nipun
Contributor
Contributor

Calculation for previous month is not working

Hi,

While computing measure "previous month ", we are using the below formula

 

Sum({<[REPORTING_DATE]={">=$(=MonthStart(Addmonths(([REPORTING_DATE]),-1)))<=$(=MonthEnd(Addmonths(([REPORTING_DATE]),-1)))"}>}REPORTING_AMOUNT)

Also tried with autocalender function:

Sum( { $< [Date(REPORTING_DATE).autoCalendar.MonthsAgo]={1} > } [REPORTING_AMOUNT] )

Still its giving the values for current month only.

nipun_0-1645110374509.png

 

Please help!

 

 

 

Labels (1)
1 Reply
Thiago_Justen_
MVP
MVP

Hi there.

Considering your date field is correctly formatted, try this out:

Sum({<[REPORTING_DATE]={">=$(=MonthStart([REPORTING_DATE],-1))<=$(=MonthEnd([REPORTING_DATE],-1))"}>}REPORTING_AMOUNT)

As you can see, second parameter either MonthStart and MonthEnd is period number.

Hope it helps you.

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago