Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Compare sales data for 2 selected months BUT USING ONLY 1 FILTER

I have some monthly sales data since 2010 and wanted to create a dashboard where a user can compare 2 separate YearMonth sales by using the same dropdowns/filters. These 2 months can be anything eg Jan-2013 vs March-2019 etc. After selecting two months in the filter, a user should see a text box with the difference of the values in those two months' sales.

I know how to do it with two separate filters for each month using Alternate State but users want only one filter where they can select two random months and see the sales difference.

Labels (5)
2 Replies
Kushal_Chawda

@qlikwiz123  You can use set like below to get difference. You can update the difference calculation according to your logic. I have used latest month(using max) - last month. Make sure that your YearMonth field is formatted using date function so that you can apply max or min function over it.

=sum({<YearMonth={"$(=date(max(YearMonth),'MMM-YYYY'))"}>}Sales)-sum({<YearMonth={"$(=date(min(YearMonth),'MMM-YYYY'))"}>}Sales)

 

AnkitaC
Contributor II
Contributor II

If select current month current year sales is there in Qlik sense pivot table but if select other moth it should be 0 and by default sales is current month current year Qlik sense expression.