Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
gs_hillmm
New 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

Tags (2)
1 Solution

Accepted Solutions

Re: Setting variable from button action requires two clicks

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).

2 Replies

Re: Setting variable from button action requires two clicks

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
New Contributor

Re: Setting variable from button action requires two clicks

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