Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

trigger action

Hi,

I need to create a check box (based on the field Brand) with multiple choice where at least 1 value must be always selected.

I try to do it by adding a trigger action on selection in the field Brand where search string is as follows:

='(' & Concat( $(=if(GetSelectedCount(Brand), '{$}','{$1}')) distinct chr(34) & Brand & chr(34),'|') & ')'

But it diesn't work.

Is there any other way to solve the task?

Thank you in advance,

Larisa

1 Solution

Accepted Solutions
oknotsen
Master III
Master III

I am guessing you mean showing 100 brands in a chart that is related to this listbox.

In that case I would suggest you add a Calculation Condition to the chart. Let's assume you want max 10 brands, add this to the Calculation Condition field on the General tab of the chart:

count(distinct Brand) <= 10

If you select more than 10 (or none and as a result all), the chart will not calculate and show an error message. You can edit the error message (via the error message button on the general tab of the chart) to explain what your user/customer has to do to get the chart to work.

May you live in interesting times!

View solution in original post

6 Replies
oknotsen
Master III
Master III

In a listbox, there always is at least one value selected. If no active selection is made, effectively all values are selected.

However,

If I misunderstood you and you always want only 1 value selected in a listbox: Make the list, select 1 value, go into the properties and on the General tab and choose for "Always One Selected Value" (found on the left side).

May you live in interesting times!
Anonymous
Not applicable
Author

Yes, I know this.

"Always One Selected Value" doesn't allow multiple choice. I'd like to have a function "Always One Selected Value" + possibility of multiple choice.


Still, thank you for the answer.


oknotsen
Master III
Master III

In that case the default functionality does technically what you want, but not visually:

If nothing is selected, everything is selected.

May you live in interesting times!
Anonymous
Not applicable
Author

I have about 100 brands in my model. Whem all is selected it doesn't look nice.

oknotsen
Master III
Master III

I am guessing you mean showing 100 brands in a chart that is related to this listbox.

In that case I would suggest you add a Calculation Condition to the chart. Let's assume you want max 10 brands, add this to the Calculation Condition field on the General tab of the chart:

count(distinct Brand) <= 10

If you select more than 10 (or none and as a result all), the chart will not calculate and show an error message. You can edit the error message (via the error message button on the general tab of the chart) to explain what your user/customer has to do to get the chart to work.

May you live in interesting times!
Anonymous
Not applicable
Author

It is very useful. Thank you!