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: 
bruchar
Contributor II
Contributor II

Variable Input Object.Show Condition Logic Based on Variable Value

Hi Qlik Community, 

I am trying to work out some set analysis expression for a show condition on 2 Variable input objects that are housed in a container object. A third variable value should determine which of the two variable input objects are visible. 

  • Variable 1: vDateGranularity - Possible Values: 'Quarter' | 'Month'
  • Variable 2: vSelectedQuarter - A list of distinct quarters/years from the supporting data
  • Variable 3: vSelectedMonth - A list of distinct months/years from the supporting data

When vDateGranularity = 'Quarter' then the variable input object for vSelectedQuarter should be visible. When vDateGranularity = 'Month' then the variable input object for vSelectedMonth should be visible. 

I've tried several different syntaxes, examples on vSelectedQuarter.ShowCondition: 

  • =vDateGranularity = 'Quarter' -> expression OK (vDateGranularity = 'Quarter), object remains invisible
  • =$(vDateGranularity = 'Quarter' -> Error in Expression (Quarter = 'Quarter'), object remains invisible
  • ='$(vDateGranularity)' = 'Quarter' -> expression Ok ('Quarter' = 'Quarter'), object remains invisible

 

 

Labels (3)
1 Solution

Accepted Solutions
MatheusC
Specialist II
Specialist II

@bruchar 

I don't see a problem with 3 example.
='$(vDateGranularity)' = 'Quarter' -> Ok expression ('Quarter' = 'Quarter')

That said, check this information:

1 - Check the value of your variable vDateGranularity=Quarter

2 - as you are quoting its value in the Variable Input. ='Quarter'

Below are printed examples:

1.

MatheusC_0-1702575882951.png

2.

MatheusC_1-1702575914601.png


Att,

Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!

View solution in original post

4 Replies
MatheusC
Specialist II
Specialist II

@bruchar 

I don't see a problem with 3 example.
='$(vDateGranularity)' = 'Quarter' -> Ok expression ('Quarter' = 'Quarter')

That said, check this information:

1 - Check the value of your variable vDateGranularity=Quarter

2 - as you are quoting its value in the Variable Input. ='Quarter'

Below are printed examples:

1.

MatheusC_0-1702575882951.png

2.

MatheusC_1-1702575914601.png


Att,

Matheus

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
bruchar
Contributor II
Contributor II
Author

Thank you for the suggestion Matheus.

That's interesting, I updated the Dynamic Values list for vDateGranularity to include single quotes ('Quarter' | 'Month') and it works now. Unfortunately the quotes now show in the drop down list as well, which I guess isn't a huge deal, it's just not stylistically preferable. I wish there was a way to make it work without showing single quotes, but this worked functionally for what I was trying to do. 

Thank you!

MatheusC
Specialist II
Specialist II

@bruchar 

Try this
Adjust your Label with the = sign

example:
Label:
='Quarter'

Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
bruchar
Contributor II
Contributor II
Author

This worked! Thank you Matheus. I also realized that I was defining dynamic variables rather than fixed variables. Switching to fixed variables allowed me to define the label / value separately. Thank you again!