Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a variable in a button

I am currently using a variable to divide one field by another. I am trying to create a button that can choose if that variable is <85% or >115% using a search string.  Is there anyway to make a button using only that variable?

13 Replies
Not applicable
Author

Its working in my sample qv document, but not in my actual one for some reason. It keeps putting the yellows along with the red selections.

johnw
Champion III
Champion III

Ah, right. For all the buttons, add another action before the select in field that clears the field first. If you already have selections, things can get weird. I didn't think about that. I'm not certain that's the problem here, but it's a problem that you'll want to fix. If we're lucky, that also fixes the bad behavior you're seeing.

Not applicable
Author

It still is not working after putting the Clear field actions before the select in field actions. My yellow is actually being selected when the red button is selected. This is what it looks like below:

button issue.png

I'm not sure why it would do that with our credentials we set.

Red: ='=$(vBurnRate)<0.85 or $(vBurnRate)>1.15'

Yellow: ='=($(vBurnRate)>=.85 and $(vBurnRate)<.9) or ($(vBurnRate)>1.1 and $(vBurnRate)<=1.15)'

Green: ='=$(vBurnRate)>=0.90 and $(vBurnRate)<=1.10'

johnw
Champion III
Champion III

I'm not spotting anything wrong there. It might have something to do with how the real data model looks vs. the simplified example one, or any number of other things that might be different in the real application. It's possible to scramble and reduce the data for upload if you want to try sharing the real application. I'm not sure what else to suggest at this point.