Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

list boxes - force filter 2 values

Hi guys,

I am doing month on month comparisons for KPIs. I want to create a situation where if the user filters for a period, the list box automatically ticks the month before that as well..

Otherwise, only the current month calculation works.. Is there any way to do that?

Thanking you in advance ,

Lucille

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

Document properties -> Trigger -> Field Event Trigger -> Month -> On Select


Action

Select in Field : Month

Search String:

='('& Concat(DISTINCT {$+<Month = {"$(=Month(MakeDate(Max(Year), Min(Month) -1)))"}>}Month, '|') & ')'

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

9 Replies
sunny_talwar

May be use triggers to accomplish this.

UPDATE: Check out the attached qvw file.

Not applicable
Author

Awesome thank you.. I can't seem to see the attached qvw file mentioned above?

sunny_talwar

MayilVahanan

Hi

Try like this

Document properties -> Trigger -> Field Event Trigger -> Month -> On Select


Action

Select in Field : Month

Search String:

='('& Concat(DISTINCT {$+<Month = {"$(=Month(MakeDate(Max(Year), Min(Month) -1)))"}>}Month, '|') & ')'

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
MayilVahanan

Hi Sunny,

Instead of Max(Month) , we can use Min(Month) right? Please suggest.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sunny_talwar

Thanks for your comments Mayil

If we are only selecting a single Month, does it matter that if we use Min or Max (or even Only)? I might be missing something, but what is your logic for using Min(Month) instead of Max(Month)?


Best,

Sunny

MayilVahanan

Hi Sunny,

For example, the user select 2 consecutive month like Mar and Apr. In that case Min(Month) -1 gives Feb.

so three month will get select. Feb, Mar and Apr.

the list box automatically ticks the month before that as well.

But anyway, Its depends on the user requirements. Maximum 2 month or "ticks the month before".



Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
sunny_talwar

Oh okay, but ya I was under the impression that only two months need to be selected based on selection in a single month. But you are right, if the they want to select the third month when 2 are selected then Min(Date) would work.

Not applicable
Author

Thank you so much I have managed to get it to work for the Period YYYYMM. I am still struggling to get it to work on the month name, I suspect I just need to play around to get it to see the month name as a date and not as a string