Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cliff_clayman
Creator II
Creator II

List Box with Yes/No flag

I need to create a List Box that has a simple yes/no flag value.  Unfortunately, I cannot add a flag in the script to handle this.  What is the best way to create a list box that can handle this?  Or, is there another method I can employ?  I would need this value to trigger a different expression to be calculated dependent upon the yes/no selection.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can change the label name to be displayed in the Label fiel on the Presentation pane. You can size the two columns of the input box by dragging the column edges. There is no visible line for the columns, but when you hover you will see a cross.  There is also alignment options on the Presentation tab. You can style it quite nice, even change the background See attached.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

9 Replies
Anonymous
Not applicable

You could use 2 text boxes labelled Yes & No with a trigger on each to set a variable to the required expression value.

johnw
Champion III
Champion III

Not what you're asking, but feels functionally equivalent to me - create a cyclic group for the two expressions in the chart. Click on the cycle icon to switch back and forth.

cliff_clayman
Creator II
Creator II
Author

No, I need it to be a list box with a simple Yes and No selection.  Then I need an expression to be calculated from that selected value.

johnw
Champion III
Champion III

Well, if it MUST be a list box, and you can't change script... hmmm... I guess you could make a do-nothing list box by using expression valuelist('Yes','No'), and then overlaying transparent text boxes working like Bill said. (Edit: semi-transparent, either green or gray, mimicking the colors of actual selection)

I don't think there's any way to create a list box that actually does something unless it's for a field or for an expression connected in some way to an underlying field. It doesn't have to be a Yes / No field, but it has to derive Yes and No in some way from some field, and then what really happens is the expression determines what values are selected in the underlying field. For example, if(match(Customer,'Ann',Bob'),'Yes','No'). That would make customer selections, selecting Ann and Bob if you select Yes, everything else if you select No. But I don't think that does you any good unless you have some useless throw away fields already in the data model that don't affect anything.

I might soon be proven wrong by someone, of course. Eager to see the solution if so.

cliff_clayman
Creator II
Creator II
Author

Can I create a variable or perhaps two variables to display and store the values?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can make an input box that sets a variable. On the Input Box constraints tab, check "Predefned Values in Dropdown" and enter Yes;No in the predefined values box.

-Rob

cliff_clayman
Creator II
Creator II
Author

Is there a way to display something other than the variable name in the input box?  Also, is there a way to decrease the spacing between the value and the drop down arrow?  I am limited for space and would like all my selection boxes to be the same size.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can change the label name to be displayed in the Label fiel on the Presentation pane. You can size the two columns of the input box by dragging the column edges. There is no visible line for the columns, but when you hover you will see a cross.  There is also alignment options on the Presentation tab. You can style it quite nice, even change the background See attached.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable

You can make an island table with inline load. And use these values in Set-Analysis of an expression.

-Ashok