9 Replies Latest reply: Jan 8, 2016 6:32 AM by Lucille Botha

# 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?

Lucille

• ###### Re: list boxes -  force filter 2 values

May be use triggers to accomplish this.

UPDATE: Check out the attached qvw file.

• ###### Re: list boxes -  force filter 2 values

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

• ###### Re: list boxes -  force filter 2 values

Hi Sunny,

• ###### Re: list boxes -  force filter 2 values

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

• ###### Re: list boxes -  force filter 2 values

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".

• ###### Re: list boxes -  force filter 2 values

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.

• ###### Re: list boxes -  force filter 2 values

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, '|') & ')'

• ###### Re: list boxes -  force filter 2 values

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