Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
danosoft
Specialist
Specialist

Select combo box

Very simple question: In a select box (dropdown list) can i choose the first element for default?

Labels (1)
19 Replies
marcus_sommer
MVP
MVP

Probably yes, with something like:

match(Field, subfield(concat(distinct Field, ',', SortParameter), ',',1))

- Marcus

danosoft
Specialist
Specialist
Author

my databse field name is:DES_REFERENTE, so my expressio will be:

 

match(DES_REFERENTE, subfield(concat(distinct DES_REFERENTE, ',', SortParameter), ',',1))

Right?

what i need to put in SortParameter?

 

marcus_sommer
MVP
MVP

The SortParameter is optional - if you leave it it will be automatically sorted in a alpha-numeric order. If this fits to your requirement you didn't need do more. But if not you may apply any numeric field as a sorting which might need to create in the script if you need any special ordering.

- Marcus

danosoft
Specialist
Specialist
Author

Ok, but if i write:

match(DES_REFERENTE, subfield(concat(distinct DES_REFERENTE, ',', ''), ',',1))

it not work, the dropdown list is blank

 

 

 

marcus_sommer
MVP
MVP

Optional parameter which aren't needed must be left out and not specified as empty string or NULL or similar. Therefore try:

match(DES_REFERENTE, subfield(concat(distinct DES_REFERENTE, ','), ',',1))

- Marcus

danosoft
Specialist
Specialist
Author

not work sorry, it is blank without values with this expression

marcus_sommer
MVP
MVP

Did you try to apply the expression within the listbox / combo box? That's the wrong place - at least like I understood your question which was that a certain value should be selected and not that this box contained just those single value.

If I understood it right this expression must be placed within an OnOpen action to select this value. Before this put this expression in a textbox to ensure that it returned your expected value.

- Marcus

danosoft
Specialist
Specialist
Author

ah i understand now, yes i had insert in a list box, so i will try to put in action in the sheet

danosoft
Specialist
Specialist
Author

 ok i tried, but it not work sorry.

my listbox have the field: des_referente

i put in action of my sheet:

- select field:  DES_REFERENTE

search string:  match(DES_REFERENTE, subfield(concat(distinct DES_REFERENTE, ','), ',',1))