Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mwscott1
Creator
Creator

How to conditionaly change variables

I have a variable for my workgroups "vWrkGrps". This variable contains 9 workgroups (WG1, WG2, WG3, WG4, WG5, WG6, WG7, WG8, WG9). What I would like to do is when my dashboard opens the variable would only contain WG1-WG8. Then with some sort of on/off filter button I could add in WG9 to the variable when needed.

Basically we have a new workgroup that we do not want calculated into our metrics for reporting, but would still like to periodically include them to see how things are progressing.

4 Replies
Clever_Anjos
Employee
Employee

Are you writing about a variable or a field?

maximiliano_vel
Partner - Creator III
Partner - Creator III

Create a new variable say vAllGroups=1

In Actions of the button you could add an action->external->set variable

In Variable: vWrkGrps

In Value: =if(vAllGroups=1, 'WG1, WG2, WG3, WG4, WG5, WG6, WG7, WG8', 'WG1, WG2, WG3, WG4, WG5, WG6, WG7, WG8, WG9')

Other Action in Same button

In Variable: vAllGroups

In Value: =if(vAllGroups=1, 0, 1)

mwscott1
Creator
Creator
Author

A variable. I use the "vWrkGrps" variable in my calculations and was trying to figure out a way to take out WG9 conditionally. I can go in and manually remove the WG9 from my variable to get the reports with and with out WG9 included. Just wondering if there was a way the end user could do this through the presentation with a filter button or something.

jonathandienst
Partner - Champion III
Partner - Champion III

Rather than using events and buttons and actions, why not save a bookmark with all the workgroups and one that excludes WG9?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein