Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set default value in listbox

Question,

I am loading a listbox for KPI selections with an expression as following:

=if($Field = 'KPI_FIELD1' or $Field = 'KPI_FIELD2' or $Field = 'KPI_FIELD3' or $Field = 'KPI_FIELD4', $Field, null())

When loading data in a listbox like this I am not able to select "Always One Selected Value" or set the default value via a trigger.

Is there a way to do this also?

Br,

Mario

9 Replies
Not applicable
Author

when you load the data. What does the list box show?

Not applicable
Author

Hi,

If you have KPI_FIELD1, KPI_FIELD2,....so on, in different list boxes, please check the "Always One Selected Value".

Then create the Listbox with expression (one that you put in your question), you should be able to see "Always One Selected Value" then.

Thanks!

Anonymous
Not applicable
Author

The listbox shows:

KPI_FIELD1

KPI_FIELD2

KPI_FIELD3

KPI_FIELD4

Not applicable
Author

Or create a new field in the script and use that for the list box. Then you can select 'Always one selected value' property.

If($Field = 'KPI_FIELD1' or $Field = 'KPI_FIELD2' or $Field = 'KPI_FIELD3' or $Field = 'KPI_FIELD4', $Field, null()) as NewField

Regards,

KKR

Anonymous
Not applicable
Author

Here is an example of what I mean.

Not applicable
Author

One way to achieve this is by creating a clear state.

Select one value from the list box, say KPI_FIELD1

Click the drop down arrow just beside 'Clear' button

Click on 'Set Clear State'

Regards,

KKR

Not applicable
Author

Or create a button with below action

'Select in Field' -> $Field as Field -> Enter any KPI field say KPI_FIELD1 in Search String

Regards,

KKR

Kushal_Chawda

Create a trigger on Activate sheet

12.jpg

sasiparupudi1
Master III
Master III

Always One Selected ValueChecking this option assures that one value will always be selected, which is useful in documents where the data only makes sense when one value is already selected, such as one currency rate. This option is enabled after one value is already selected in the list box. This option is not available for calculated fields.