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

Set variables based on check box

Hi Everyone,

I have a listbox with 2 values which I have set up as a check box. Is it possible to set the value of a variable based on whether or not a line in the check box is checked?

Basically, when the first line is checked off, I want variable 1 to take some value, and when the second line is checked off I want variable 2 to take a separate value.

I've messed around with GetCurrentSelections, Match, and Concat but am not having any luck. A sample qvw file is attached.

Thanks!

Michael

1 Solution

Accepted Solutions
sunny_talwar

Check if the attached helps

Capture.PNG

Capture.PNG

Variables

1) =If(SubStringCount(GetFieldSelections(CheckBox), 'Some_Text1') = 1, 'Hi World')

2) =If(SubStringCount(GetFieldSelections(CheckBox), 'Some_Text2') = 1, 'Bye World')

View solution in original post

3 Replies
sunny_talwar

Check if the attached helps

Capture.PNG

Capture.PNG

Variables

1) =If(SubStringCount(GetFieldSelections(CheckBox), 'Some_Text1') = 1, 'Hi World')

2) =If(SubStringCount(GetFieldSelections(CheckBox), 'Some_Text2') = 1, 'Bye World')

Anonymous
Not applicable
Author

Perfect. That seems to be exactly what I am looking for.

Thanks!

sunny_talwar

Awesome