Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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

Tags (4)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Select max value in list box by default

You can try using the OnOpen document trigger.


talk is cheap, supply exceeds demand
10 Replies
MVP & Luminary
MVP & Luminary

Re: Select max value in list box by default

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

Re: Select max value in list box by default

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.

MVP & Luminary
MVP & Luminary

Re: Select max value in list box by default

You can try using the OnOpen document trigger.


talk is cheap, supply exceeds demand
Not applicable

Re: Select max value in list box by default

Thanks Gysbert,

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

MVP & Luminary
MVP & Luminary

Re: Select max value in list box by default

Yes


talk is cheap, supply exceeds demand

Re: Select max value in list box by default

Hi,

maybe this helps:

QlikCommunity_Thread_138019_Pic1.JPG

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

regards

Marco

Not applicable

Re: Select max value in list box by default

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

Re: Select max value in list box by default

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

Re: Select max value in list box by default

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?