Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Not applicable

how to set default selection

I would like to know how to set default selection in sheet object. ie. when we first login, the max(year) should be selected by default.

Thanks.

Tags (2)
10 Replies
Not applicable

how to set default selection

Hi,

Go to Settings -> Document Properties -> Triggers

Select the “OnOpen” trigger and press “Add Action”

Add the Select in Field Trigger (section Selection)

Field: year

Search String: = max(year)

Hth,

Thilo

Highlighted
adhudson
Contributor II

how to set default selection

Hi,

     I am assuming that you have the year field as a selection criteria and it appears as a list box.

   

     So now, goto the list box properties and select "Always one selected value" in general tab of the list box properties.

Regards

Andrew Hudson

Not applicable

how to set default selection

Hi,

If you want max(year) or any other year selected in that field to stay selected even if you press selcted then go by Andews's way but if you want that when you press clear year should be cleared also. Then, go by triggers way as Thilo suggested.

One thing to note here is that if you go by Always one selected value as suggested by Andrew then you will never be able to select more than one year. (for example you can not select 2010 and 2011 both).

So, it all depends your requirement but always one selected mode should be preferred over triggers.

..

Ashutosh

Not applicable

how to set default selection

Thanks for your detailed explination. See what i am thinking is i can not use "onOpen" trigger, because 1st timelogin that is fine with trigger, but if I am playing on different tabs and comeback to dashboard , then the trigger will reset my year selection to max(year) insted of keeping my selection from different tab.  I did not know how Andrew option works because "Always one selected value" is disable for this list box in my case.

See all i need this selection only 1st time login. So i am thinking of set this when login only. so after login and play with different sheets and still maintain the year selection across the sheets.

Is there any way i can incorporate this trigger or some thing during the authientacation.

Thanks.

Not applicable

how to set default selection

Hi,

Always one selcted is not disabled for your liast box. You first select any one value then go to list box properties and then it will be available.

Also, for your requirement on open trigger should work fine because it is not dependent on tabs, so if you go to different tab, do some selections and come back to first tab it will not change your selections. This behavior is of on Activate sheet trigger.

On Open trigger will work when the application is opened by the user. So, a user opens an application then this trigger will run and select max(year) in your year field but then it will not run for his entire session. Then again user closes the application and next time it again opnes then it will again run the trigger.

Hope this makes sense.

..

Ashutosh

chandashok
Contributor III

Re: how to set default selection

Hi

     Hope the attached file will be solve your problem.

     Settings-->Document Properties-->Triggers-->DocumentEventTriggers--->OnOpen--->add action-->Select in Field ( Field --> year , Value-->Max(Year))

Regards

Ashok

Not applicable

Re: how to set default selection

Hi,

I am using 2 Triggers for it 1 for max(Year) and 2 for max(Month).

But my max(Year) is 2012 and max(Month) in 2012 is Aug. and not Dec.

When I open my document it is showing data where max(Year)=2012 & max(Month)=Dec

I checked this using text objects. But in actual it should show me 2012 Aug data right?

Can you please help me regarding this?

- Yojas

hkapadia
New Contributor III

Re: how to set default selection

I was looking for the similar thing & did what was mentioned here & it worked for me.

Thank you all for providing the direction.

admin1
New Contributor III

Re: how to set default selection

Is there a way to select more that one value in a drop down using this method?