Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

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

Tags (1)
9 Replies
Highlighted
Not applicable

Re: Set default value in listbox

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

Highlighted
Not applicable

Re: Set default value in listbox

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!

Highlighted
Contributor III
Contributor III

Re: Set default value in listbox

The listbox shows:

KPI_FIELD1

KPI_FIELD2

KPI_FIELD3

KPI_FIELD4

Highlighted
Not applicable

Re: Set default value in listbox

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

Highlighted
Contributor III
Contributor III

Re: Set default value in listbox

Here is an example of what I mean.

Highlighted
Not applicable

Re: Set default value in listbox

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

Highlighted
Not applicable

Re: Set default value in listbox

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

Highlighted

Re: Set default value in listbox

Create a trigger on Activate sheet

12.jpg

Highlighted
Master III
Master III

Re: Set default value in listbox

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.