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: 
Not applicable

PAST SIX MONTH COMPARISON

I WANT TO COMPARE MY CURRENT MONTH WITH LAST SIX MONTH SALES.

EG. WHEN I SELECT (JAN 2014) I WANT THE PIVOT TABLE TO SHOW ME LAST SIX MONTHS AS SHOWN BELOW IN SALES (DETACHED) PIVOT TABLE.

ANY SUGGESTIONS???

sales.5.PNG.png

Labels (1)
5 Replies
aveeeeeee7en
Specialist III
Specialist III

Hi

Use this in your expression:

Sum( {$<Date={">=$(=MonthStart(AddMonths(Max(Date),-6)))<$(=MonthEnd(Max(Date)))"}>} Sales)

jerem1234
Specialist II
Specialist II

Maybe something like:

sum({<MonthYear = {'>=$(=addmonths(max(MonthYear), -6))<=$(=max(MonthYear))'}>}Sales)

If nothing is selected, it will take show the latest 6 months.

Hope this helps!

Not applicable
Author

Hey jerem,

i am using the same expression to get my sales for last six month but when i change  -6 to -5 its giving me the same result as -6.

jerem1234
Specialist II
Specialist II

Does it also give the same result as -4? Have you tried using Nag Aviral's formula? Can't be sure why its giving you that result, could you post a sample qvw demonstrating the problem?

Not applicable
Author

I figured it out With Jerem's/nag expression.

thanks guys.