Skip to main content
Announcements
Meet the 2024 Qlik Luminaries and Partner Ambassadors! READ ON!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show/hide condition based on filter selection

I have filter whose values are Yes /No

So based on the below conditions i want to show/hide an object

  • if filter is no or no values is selected or both the values are selected then apply to expression 1
  • if filter is yes or no values is selected or both the values are selected then apply to expression 2

I having issues implementing all the three conditions at once. I hoping someone can help me to figure this thing out?


Thanks in advance.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

  • if filter is no or no values is selected or both the values are selected then apply to expression 1

       for expression1: =max(match(YesNoField,'No'))

  • if filter is yes or no values is selected or both the values are selected then apply to expression 2

       for expression2: =max(match(YesNoField,'Yes'))


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Not applicable
Author

Can you post an example qvw?

thanks

Not applicable
Author

Maybe something like...

=if(
(GetFieldSelections ([YourFlag])='no'
or GetSelectedCount([YourFlag])=0
or GetSelectedCount([YourFlag])=2
)
,Expression1
,Expression2
)

Looking at your original post I'm not sure your conditions are quite right?.. where no value is selected or both values are selected both expression 1 and and expression 2 would apply. Is that what you mean?

Gysbert_Wassenaar

  • if filter is no or no values is selected or both the values are selected then apply to expression 1

       for expression1: =max(match(YesNoField,'No'))

  • if filter is yes or no values is selected or both the values are selected then apply to expression 2

       for expression2: =max(match(YesNoField,'Yes'))


talk is cheap, supply exceeds demand
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

What I will look to do is have a variable in Variable Overview window or move it into the script (entirely up to you) but it content will be

vTest  = IF(IsNull(Data) OR GetCurrentSelections(Data) ='No'  ,0, 1)

Please note

Data here is the field you want to monitor so replace it with the field of interest to you.

Then in the object you want to show or hide. Go to the properties - Layout - Show Conditions and enter vTest = 0.

When you make selection in the field you want to monitor the object will disappear.

Try this


Not applicable
Author

You can solve that issue setting up an "array variable"

Check the attached example

Not applicable
Author

I have a similar, likely easier scenario. Can you assist?

I have field (Project) that contains 'n' number of project values.

I want to create a Text Object that will only show the Project value when a user selects 1 value from the 'Project' List Box selection; Else the Text Object should not show. I don't want to use a Button to drive this, simply the user selects a project value and then this Text Object displays that Project value, else the Text Box object doesn't show. Thanks!!