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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Karthick30
Creator
Creator

Dynamic Filter Updation

Hi,

 I have a field called Period. starts from 202101 to 202204. I need to apply this period field in Filter section but I want to show only 12 months of data only(dynamically based on current month). For example, If I open that filter now, it needs to show 202105 to 202204(12 months). If I select next month, then it needs to show 202106 to 202205. dynamically it needs to show last 12 months period in filter.

Any help on this please

Labels (3)
1 Reply
anthonyj
Creator III
Creator III

Hi @Karthick30,

Add this into your filter dimension:

=if(date#(Period,'YYYYMM') > monthstart(date#($(=max({1}Period)),'YYYYMM'), -12), Period)

This will give you the period you're looking for based on the maximum period in your data. The Date#( ) functions are to ensure Qlik translate your dates correctly for the monthstart( ) function.

Regards

Anthony