Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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