Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Calculate sum of sales for selected month and its previous month dynamically

Hi

I have created a pivot table and i need to calculate (sum of sales for selected month - sum of sales for previous month of selected month) for 3 months based on user selection

 

1 Reply
Highlighted
Partner
Partner

try :

sum({<Date,Month={"<=$(=max(Month))>=$(=max(Month)-2)"}>}Value)

 

or

sum({<Month,Date={"<=$(=max(Date))>=$(=MonthStart(addmonths(max(Date),-2)))"}>}Value)