Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select max value in list box by default

Hi,

I have a problem of getting the max date selected in a list box. I am not sure how this needs to be done. Greatly appreciate any advice.

Thanks,

Gayan.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You can try using the OnOpen document trigger.


talk is cheap, supply exceeds demand

View solution in original post

10 Replies
Gysbert_Wassenaar

Why does it need to be done? What's the problem with letting the user decide which date should be selected? Sort the date listbox in descending order if necessary to let the user easily select the maximum date.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Gysbert,

The reason being I need to keep the most recent date selected by default so that the users when opening the document will first see the most recent details and if needed can select previous dates.

Hope this helps.

Gayan.

Gysbert_Wassenaar

You can try using the OnOpen document trigger.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert,

Is it the 'select in field' action we need to use?

Gysbert_Wassenaar

Yes


talk is cheap, supply exceeds demand
MarcoWedel

Hi,

maybe this helps:

QlikCommunity_Thread_138019_Pic1.JPG

http://community.qlik.com/message/635453#635453

regards

Marco

Not applicable
Author

Thanks Gysbert and Marco for the illustration. I tried adding the action but on the reload, I cannot get the list box to highlight the max date. Is it something I've missed? The list box controller has the 'census_time' assigned. I have attached the screenshot of the action.

Default Date.jpg

sunny_talwar

I would create a text box with the same expression (=max({1} census_time) to check if the this is the same format as the format of census_time in the document properties. If the format is different, I would think that the selection won't be made. So you will essentially have to force the format to be the same one by using Date function if census_time is a date.

I hope this helps.

Best,

S

Not applicable
Author

Hi,

I have no idea how you data looks like but what happens if you just use the max(census_time) as I assume your users dont have any other selections triggered on document opening?