Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
gs_hillmm
Contributor
Contributor

Setting variable from button action requires two clicks

I've searched the forums for a similar thread but haven't found an answer.

A section of my UI allows users to either enter their own 'threshold' through the 'Threshold amount' input box or select one of two buttons that post pre-determined values - 'reversing' (value = 1000000) and 'permanent' (value = 10000). These text values are in a table and the numeric threshold value is in the same row as the text.

_PorRlabelThresholdAmt
Permanent10000
Reversing1000000

ReverseUI.png

The buttons are text boxes formatted with an image. The actions assigned are:

ActionsField/VariableSearch string/Value
Select In Field_PorRlabel='Reversing'
Set VariablevCurrentThreshold=Only(ThresholdAmt)

The first time the button is clicked, it selects the correct value in the _PorRlabel field and set analysis in a straight table responds accordingly. However, vCurrentThreshold doesn't get set to the correct number unless the button is clicked a second time.

Thanks in advance..

Dave

1 Solution

Accepted Solutions
Nicole-Smith

All Variables get set before any Select in Fields happen (no matter what order you have them in the actions dialog).  To get around this, change your set variable search string to =Only({<_PorRlabel={'Reversing'}>}ThresholdAmt).

View solution in original post

2 Replies
Nicole-Smith

All Variables get set before any Select in Fields happen (no matter what order you have them in the actions dialog).  To get around this, change your set variable search string to =Only({<_PorRlabel={'Reversing'}>}ThresholdAmt).

gs_hillmm
Contributor
Contributor
Author

Thanks for the quick response. That is exactly what I need.