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: 
Not applicable

Require a Minimum of one value selected in a list Box

I have an application which has many list boxes for selecting values. One of the list boxes has 100+ entries. If a user does not select at least one value from this list and at least one YEAR the server bogs down for all apps. The database has millions of rows with many fields and values. The General Tab for List Box Properties has a check box for requiring one value to be selected but only one value. I need the ability to require AT LEAST one value, but to have the option of selecting two or more selections.

Any suggestions?

5 Replies
matt_crowther
Luminary Alumni
Luminary Alumni

Under the list box properties look under the Presentation tab (I think) there's a check box 'Always One Value Selected' - check it and even after a 'clear' one value will remain. Hope that helps. Matt
matt_crowther
Luminary Alumni
Luminary Alumni

Apologies: I should have read the post twice - you've already tried that. Apologies- Matt
Not applicable
Author

In the document properties, set an "On Open" action of "Select in Field" that pre-selects a value from the list field (lets call it BigList), i usually find either

=max(Biglist)

or

=min(BigList) works fine

On all your other objects within the document set a "caluclation condition" of

GetSelectedCount(Year)>0 and GetSelectedCount(BigList)>0

and that object wont even attempt to calculate until something is elected in either field

johnw
Champion III
Champion III

You could do it with a macro OnSelect and OnChange of the field:

sub AtLeastOne()
set field = ActiveDocument.GetField("ID")
if field.GetSelectedValues.Count < 1 then
field.select ActiveDocument.Evaluate("=minstring(ID)")
end if
end sub

Better if there's a way to do it with an action, but I'm not thinking of how. Not very experienced with actions yet.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The approach I usually take is to place a calulation condition on the objects that are slow if the selections are not made. Then set a custom message that informs the user "Please select at least one Year and a value".

-Rob