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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
eddywong71
Creator
Creator

Restrict the months in dimension filter

Hi Anyone,

May I ask how to create a Month filter no affect the back end data.

For example ,I have 2 Year data (202201-202312). I want to create a filter the user only can choose(202301-202312). 

The filter as below expression.

If( Date#(Month,'YYYYMM') <= Date(MonthStart(vMaxMonthYear,0) ,'YYYYMM')
AND
Date#(Month,'YYYYMM') >= Date(MonthStart(vMaxMonthYear,-11) ,'YYYYMM')

, Date(Month,'MMM YY'))

However, this expression let the user can't access all the data from (202201-202212) which is not I want . It is because I have some YTD Comparison and past year chart.

I just want to limit user choosing the filter only.

 

Labels (2)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

@eddywong71 

Are these two range periods bringing the correct periods? With the Year/Month date formatted,
try this:

aggr(Only({< DateMonth ={ ">=$(=Date(MonthStart(DateMonth,-11) ,'YYYYMM'))<=$(=Date(MonthStart(DateMonth,0) ,'YYYYMM'))" }>} DateMonth),DateMonth)



- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

1 Reply
MatheusC
Specialist II
Specialist II

@eddywong71 

Are these two range periods bringing the correct periods? With the Year/Month date formatted,
try this:

aggr(Only({< DateMonth ={ ">=$(=Date(MonthStart(DateMonth,-11) ,'YYYYMM'))<=$(=Date(MonthStart(DateMonth,0) ,'YYYYMM'))" }>} DateMonth),DateMonth)



- Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!