Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List box single selection

Hi,

There is one list box as 'Time Period' in my report.

There is a requirement that user should be able to select only one value at a time.

But user should also be able to deselect it.So I cant check the always one selected value.

Is there any way to solve this issue.

Please find the attached list box image for the same.

Thanks in Advance !!


7 Replies
Not applicable
Author

You can use field event trigger on [time period] field to clear it if selectedcount >1. This is some work around to force user to select a single value. The expression to clear field will be if(GetSelectedCount([Time Period])>1,'[Time Period]').

clear.bmp

Not applicable
Author

Lets look at it like this. If the user is able to deselect they are in essence making all values available in any object that references to that field as a dimension. In QlikView, it would be the same as selecting all values.

However, if the chart or object using that value has a calculate conditional for when getselectedcount is one, then I can understand where this would be useful.

My suggestion as I know no other way to clear the selection when only 1 selection is enabled is to do one of the following

1) Create an input box with a concat function to list all values in a drop down. Forcing the user to select a value or blank

2) Min or MaxString can be used to force QlikView to select one value even though the list box has multiple values. The value that will be used in the object can be represented by a text box indicating which value has taken precedence

3) If your list box contains only a few options, then maybe FieldValue and FieldIndex can be used with a forced element number of 1

Hope the above is useful to you in any way

Cheers,

Byron Van Wyk

QlikVieW & Other Ramblings

makkemik
Partner - Contributor III
Partner - Contributor III

Hello,

QV 11 version....

You can use in the listbox properties (General tab);

oneselected.png

I hope you are asking this information.

Regards

Murat

Not applicable
Author

No I can't check Always one selected value property. Because it will not allow to deselect the option.

makkemik
Partner - Contributor III
Partner - Contributor III

May be you can put the empty action in your data for a example "deselect" if you want to deselect your time schedule you can choose that value in filter.

it is the easy way I think.

regards

Murat

gopalopsharma
Creator
Creator

Hello Priya,

You can follow the steps below:

1. Go to Document Properties/ field trigger

2. On Select-->Select in Field

3. Time Period

4, in the expression Type:

If(getselectcount(TimePeriod),maxstring(TimePeriod))

In this way user will be able to select/ deselect values but not multiselect. Instead of Maxstring minstring function can also be used.

Hope it helps..

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

Maybe like the attached example,

regards