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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set variable value when a certain selection is made

I'm trying to set variable vButton=1 when the current year is selected and no selections are made in other calendar fields (QUARTER, MONTH, MONTH-YEAR). This will change the color of my YTD button.

I tried to add a Trigger Action under Document Properties, but the Field Event Triggers don't allow me to prescribe a condition like below. Can anyone help??

(GetFieldSelections(YEAR)=YEAR(Today()),vButton=1)

2 Replies
maxgro
MVP
MVP

to change the color of a button add an expression for Calculated in the color of the button

something like (adapt to your requirement)

=if(GetPossibleCount(SerialNumber)=1 and GetPossibleCount(Year)=1,red(), green())

I don't think you need a variable and/or trigger

sundarakumar
Specialist II
Specialist II

create a calculated color for the text box (background) like

=if(getselectedcount(year)=1 and getselectedcount(month)<>1 and getselectedcount(monthyear)<>1

     ,    newcolor(),     oldcolor());

-Sundar