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: 
surajap123
Creator III
Creator III

show last 12 months

Hi All,

I want to display on last 12 months in the month-year ribbon.

months.JPG

In this example Jan-2017 should not be in the list.

Could you please help me with the expression to write in the listbox.

1 Solution

Accepted Solutions
sunny_talwar

Then this should work

=Aggr(Only({1<MonthYear = {"$(='>=' & Date(MonthStart(Max({1}MonthYear), -11), 'MMM-YYYY') & '<=' & Date(MonthStart(Max({1}MonthYear), 0), 'MMM-YYYY'))"}>} MonthYear), MonthYear)

View solution in original post

5 Replies
sunny_talwar

May be this

=Aggr(Only({1<MonthYear = {"$(='>=' & Date(MonthStart(Max(MonthYear), -11), 'MMM-YYYY') & '<=' & Date(MonthStart(Max(MonthYear), 0), 'MMM-YYYY'))"}>} MonthYear), MonthYear)

But what would you need to see if a certain MonthYear is selected? Let's say Jun-2017 is selected? Would you still want to see the same 12 Months or will it now show the 12 months from Jun-2017 and before?

sunny_talwar

Or this

=Aggr(Only({1<MonthYear = {"$(='>=' & Date(MonthStart(Max({1}MonthYear), -11), 'MMM-YYYY') & '<=' & Date(MonthStart(Max({1}MonthYear), 0), 'MMM-YYYY'))"}>} MonthYear), MonthYear)

surajap123
Creator III
Creator III
Author

Thanks for the help sunny.

I want only last 12 months in the ribbon and the months should not be auto-ascending based on user selection and should not change based on user selection and i want latest month to be in the left side of the ribbon.

Thanks! again

sunny_talwar

Then this should work

=Aggr(Only({1<MonthYear = {"$(='>=' & Date(MonthStart(Max({1}MonthYear), -11), 'MMM-YYYY') & '<=' & Date(MonthStart(Max({1}MonthYear), 0), 'MMM-YYYY'))"}>} MonthYear), MonthYear)

surajap123
Creator III
Creator III
Author

Thank you so much for your help