Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahamed_Qlik
Specialist
Specialist

Default selection

Hi All,

On opening the document, I want to show the last two years to be selected as default.

I do have field named as Year.

Year

2012

2013

2014

2015

2016

So, when opening the document I want 2016 and 2015 should be selected.

Please advise.

Regards,

Mahamed

8 Replies
Anonymous
Not applicable

Hi mahamed,

1.- Create a variable like this: vEntrySelections = '('&Max({1}Year)&'|'&Max({1}Year)-1&')'

2.- On Document Properties -> Triggers -> Document Triggers -> On Open:

     Field -> Year

     Search String -> =$(vEntrySelections)

Regards!!!

avinashelite

Try like this :

Go to >Document properties > Triggers > On Open Trigger  >select in Field

Select the Year field and write this expression

'('&Max(Year,1) &'|'&Max(Year,2)&')'

Not applicable

Create a trigger ,

Select the Year field

expression

='>=$(Variable1)'

where Variable1=max(Year)-1

Thanks

Khushboo

Mahamed_Qlik
Specialist
Specialist
Author

Hi Khushboo.

Thank you for your kind response. But using your expression will give me only single year data.

You are using the Variable1=max(Year)-1 ie. the variable will store only max year -1

for example my max year is 2016 then your variable will store 2015 and on opening it will show single year only.

But, appreciate again for your kind response.

Regards,

Mahamed

sasikanth
Master
Master

HI, Mohamed

You might not understand the

expression

='>=$(Variable1)'

The above expression select all the values which are greater than the given value

here given value i.e. Variable1=max(Year)-1 = 2015 , so it will select 2016 and 2015 both

you can write the expresion directly

avinashelite

Did you tried my suggestion

Go to >Document properties > Triggers > On Open Trigger  >select in Field

Select the Year field and write this expression

'('&Max(Year,1) &'|'&Max(Year,2)&')'

Kushal_Chawda

Go to >Document properties > Triggers > On Open Trigger  >select in Field

Select Year field and write below expression in Value

='(' & concat(distinct {<Year={">=$(=max(Year)-1)"}>} Chr(34) & Year & Chr(34),'|') & ')'

susovan
Partner - Specialist
Partner - Specialist

Hi mahamed,

Try this Way

Go to >Document properties > Triggers > On Open Trigger  >select in Field

Field : " Year "

Search String : " ='(' & (vYear1) & '|' & (vYear2) & ')' "

Here,

vYear1=Max(Year)

vYear2=Max(Year)-1

Warm Regards,
Susovan