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: 
Karahs
Partner - Creator
Partner - Creator

Difference between two selections

Hello Everyone,

        I have Two columns ie. Month and Cost , i want difference on basis of my selction of month.

     Eg. If i select Feb and March from Month Column i should gets the difference between them  ,

      If i select Jun and Jul from Month Column i should gets the difference between them .

Need to find the difference  ???

Thanks

2 Replies
Not applicable

Hi Kshitija

You can use the Month field in a listbox. So when you chose the dates in the listbox it will filter your Qlikview model to just look at that those months you selected including the difference calculation

sunny_talwar
MVP
MVP

May be something along these lines:

Sum({<month_id = {$(=Max(month_id))}>}Sales) - Sum({<month_id = {$(=Min(month_id))}>}Sales)

Where month_id is created in the script like this:

Year*100 + Num(Month) as month_id