Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Prink
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
OmarBenSalem

try :

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

 

or

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