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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
cgT
Creator
Creator

Button Background change based on selection

Hi there,

I'm trying to use the following expression to format the background of a button based on expression:

=if(TransactionDate = '>=$(=WeekStart(Today() - 7))<=$(=WeekEnd(Today() - 7))', '#f3f4f6', '#ffffff')

It's important that the dynamic selection is what drives the change in background colour, however this doesn't seem to be working.

Can anyone help please?

Thank you in advance,

 

Labels (2)
1 Solution

Accepted Solutions
cgT
Creator
Creator
Author

I have now solved this using variables, but thank you for offering up a solution.

View solution in original post

3 Replies
Kushal_Chawda

@cgT   seems you are using set expression condition in if statement. tyr below

=if(TransactionDate >= WeekStart(Today() - 7) and 
TransactionDate <= WeekEnd(Today() - 7), '#f3f4f6', '#ffffff')
cgT
Creator
Creator
Author

Thanks for the speedy reply, Kushal.

Unfortunately it doesn't seem to work. I click the button with this in place and nothing changes in terms of the button's appearance.

cgT
Creator
Creator
Author

I have now solved this using variables, but thank you for offering up a solution.