Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
balajisj30
Creator
Creator

Display last 12 months data - qliksense

Hello People

I want to display last 12 months sales data of different categories in a line chart. So i wrote the set analysis expression,

Sum( {$<month1={">=$(=MonthStart(AddMonths(Max(month1),-12)))"}*{"<$(=MonthEnd(Max(month1)))"}>} sales)

I get last 12 months data when i select month filter but the categories are not getting displayed.

saa.png

Please help me solve this issue.

3 Replies
prma7799
Master III
Master III

Please try this

SUM({$< MonthName=, Year={$(=max(Year)-1)},Quarter=

,[month1]={">=$(=MonthStart(max([month1),-12))<=$(=Monthend(addmonths(max([month1]),-12)))"}

>}[sales]

balajisj30
Creator
Creator
Author

No. the code is not working. It gives me only selected month and selected - 12th month sales data. Even then categories are not getting displayed.

prma7799
Master III
Master III

Please share some sample app.