Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Change color of the button by an exact match with the selection of the user

Hi together,

does anyone know how to write the condition for the inquiry if the months of the actual year are selected by the user?


I want that the button is colored black when the selection of the User corresponds with the set standard selection of the button.

Light grey= not active

Black= active


Goal: Today > May 2016

If the user select exaxtly: 2016 + 01, 02, 03, 04, 05 then the button should be black

                    


That are the settings of the button:

=If(GetFieldSelections(Jahr)= year(today()) and GetFieldSelections(Monat)<= month(today()), 'qmem://Icon/Icon_Home_px256_Black', 'qmem://Icon/Icon_Home_px256_Grey238')

The red part is wrong. By this way the button is black once a month selected by May.


Correct should be:

=If(GetFieldSelections(Jahr)= year(today()) and GetFieldSelections(Monat)= '01, 02, 03, 04, 05', 'qmem://Icon/Icon_Home_px256_Black', 'qmem://Icon/Icon_Home_px256_Grey238')

But how to write something in a changeable form (dynamic)?

Greetings

Lisa

1 Solution

Accepted Solutions
perumal_41
Partner - Specialist II
Partner - Specialist II

Try below

=If( GetFieldSelections(Jahr)= year(today()) and  GetFieldSelections(Monat)= concat(ValueLoop(1,num(month(today())),1),', '), 'qmem://Icon/Icon_Home_px256_Black', 'qmem://Icon/Icon_Home_px256_Grey238')

View solution in original post

5 Replies
sunny_talwar

How about this:

=If(GetFieldSelections(Jahr) = Year(Today()) and RangeMax($(=GetFieldSelections(Monat))) <= Num(Month(Today())),

'qmem://Icon/Icon_Home_px256_Black', 'qmem://Icon/Icon_Home_px256_Grey238')

Anonymous
Not applicable
Author

go to the listboxand go to the action tab to give action selection in field to get the out put

qliksus
Specialist II
Specialist II

May replace it with something like

count({1<nMonth={"<=$(=max(nMonth))"}>}DISTINCT nMonth ) <=num(month(today())

perumal_41
Partner - Specialist II
Partner - Specialist II

Try below

=If( GetFieldSelections(Jahr)= year(today()) and  GetFieldSelections(Monat)= concat(ValueLoop(1,num(month(today())),1),', '), 'qmem://Icon/Icon_Home_px256_Black', 'qmem://Icon/Icon_Home_px256_Grey238')

Anonymous
Not applicable
Author

Hi Perumal,

great ... thank you, it is working :-).

Will you please help me with the formatting?

I do not get it into the right form > I need two decimal places.

My experiments with the num function were unsuccessful.