Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
francis_gr
Creator
Creator

select by default last 3 years in list box

Hi all!!

In a list box i can select years (from 2011 to current year).

How do i select by default last 3 years in the list box but show in the list box all years?

Thanks for  your help

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Or use this to select the current and two years back:

='('&(year(today())-2)&'|'&(year(today())-1)&'|'&year(today())&')'

View solution in original post

4 Replies
trdandamudi
Master II
Master II

Go to Document Properties and then select the tab "Triggers"

Select "OnOpen" under Document Event Triggers and click on "Add Action(s)"

Click on "Add" button"

Select "Selection" under Action Type

Select "Select in Field" under Action and click OK

Select your field in the "Field" box

In search string box type your three years. for example you want to show 2011,2012,2013 by default then type this (2011|2012|2013)

click Ok and save the file and close it.

Now when you open the file it will have three years selected by default.

johnw
Champion III
Champion III

Or use this to select the current and two years back:

='('&(year(today())-2)&'|'&(year(today())-1)&'|'&year(today())&')'

francis_gr
Creator
Creator
Author

Hi Thirumala!

Thanks for your reply. It works fine and i have learned to use the triggers.

best regard.

francis_gr
Creator
Creator
Author

Hi John!

Thanks for your reply.

Your expression do what i need. It's dynamic and i will not have to change the selection manually.

Best regards