Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
anindya_manna
Creator II
Creator II

How to create pivot table with last 3 months purchase?

Hi,

I want to create a pivot table exactly as below. I have channel name ,Purchase value, month,year in DB. How I can create last 3 months purchase in column value?

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps with an expression like

sum({<month={">=$(=max({<year={`$(=max(year))`}>}month)-2)<=$(=max({<year={`$(=max(year))`}>}month))"}>}[Purchase value])

And perhaps not. It depends on what kind of data values your month field contains. Strings like 'Jul' and 'Aug' won't work in the above expression.


talk is cheap, supply exceeds demand