Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tomovangel
Partner - Specialist
Partner - Specialist

Switching between 2 variables

Hello, dear Qlikers !

I have 2 variables - vWeek and vMonth and sliders for each.

The variables are used on a slider with values for sales per Week and per Month. 

For example if the user moves the slider  for vMonths to 100,
The visualizations will show all customers who have sales more than 100 per month.

And respectively, if the user moves the slider for vWeek to 10, it will show all customers who have sales per week more than 10.

As you can probably guess, for vWeek to show any visualizations, vMonth has to be 0, and for vMonth - vWeek has to be zero.

My question is how to make vWeek go to 0, if the user selects vMonth slider to 10.
I did a pop-up text box telling the user to select only 1 of the values. But this is bad user experience, to have pop ups with errors.
So i want to make it automatic.

Any suggestions ?
-Thanks

1 Solution

Accepted Solutions
marcus_malinow
Partner - Specialist III
Partner - Specialist III

In Document Properties, Triggers, you can set up a Variable Event Trigger on each of your variables.

On Change of your variables, Add Action,External, Set Variable. Set the other variables to 0

View solution in original post

10 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

In Document Properties, Triggers, you can set up a Variable Event Trigger on each of your variables.

On Change of your variables, Add Action,External, Set Variable. Set the other variables to 0

Anil_Babu_Samineni

Could be possible using Triggers for first variable and OnChange to 0 using same variable as variable. But, How you are sliding to each from 0 -- etc..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vishsaggi
Champion III
Champion III

May be create a variable trigger (From document properties Triggers tab) on vWeek to change to 0 onChange of vMonth? Is this what you want?

Kushal_Chawda

Go to Document properties-> Triggers -> Variable event trigger ->  select vMonth -> OnInput -> Add action-> External->Set variable

Variable : vWeek

Value : 0


Likewise you can set the trigger on vWeek to make the vMonth 0

tomovangel
Partner - Specialist
Partner - Specialist
Author

I have read, that Triggers aren't well accepted by , and it is bad practice to use it.

But this is Exactly what I was looking for, I will mark your answer correct, I just want to see if there is any other way without triggers

Thanks man

vishsaggi
Champion III
Champion III

I believe too many triggers would be a bad practice but having fewer ones should be fine.

tomovangel
Partner - Specialist
Partner - Specialist
Author

well, in Total i got 6 triggers, because i have 6 variables 3 for week and 3 for month.

So I guess my performance will not drop down ?

right?

vishsaggi
Champion III
Champion III

Should be fine.

tomovangel
Partner - Specialist
Partner - Specialist
Author

okay, Thanks my man