Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
dia2021
Creator
Creator

Dashboard functionality to manually change the color

Hi Everyone,

I have a question regarding the dashboard's functionality; there is something that I can provide to the users on the front end.

I have developed a dashboard full of KPIs with the thresholds set up at the back end that changes color green, light green, and yellow according to the targeted value. The client wants me to provide the functionality to manually change the threshold color to red on the spot if they decide it needs to turn red. 

My concern is - Is this possible to provide in the qliksense? If yes, how can I do it? What feature or function can I use? 

Thank you!

 

Labels (2)
1 Solution

Accepted Solutions
anthonyj
Creator III
Creator III

Hi @dia2021 ,

Yes you absolutely can set this in one button.

Now, I have used a button as a KPI in this instance so I could use colour by expression rather than the set limits in the KPI object. I just put the measure in the label under General.

anthonyj_2-1635717058448.png

 

anthonyj_4-1635717144907.png

 

So, under the Font colour by expression, I used this condition.

=if($(vColourChange) = 1, red(),
if(count(Column) > 3, green(), red()))

I then added a standard button from the visualisations and in the Actions and navigation chose the action "Set variable value". The variable is vColourChange.

Under the value I added this condition.

=if( $(vColourChange) = 1, 0, 1)

To add more clarity behind the action button, I made the label dynamic depending on the intended action if pushed. This is under General >> Label.

=if($(vColourChange)=0, 'Change to Red', 'Reset')

I hope this helps in your dashboard.

Thanks

Anthony

View solution in original post

4 Replies
anthonyj
Creator III
Creator III

Hi @dia2021 ,

If you have conditions already set up to control the colours of your measures then you could add another condition to this based on a variable value.

I have set a variable called vColourChange to 0. Then I put a variable input on the canvas and set it to button and add the vColourChange. In the values I choose Dynamic and enter in:

='1~Change to Red|0~Change Back'

and in the colour expression I have added

=if($(vColourChange) = 1, Red(),
if(count(Column) < 10, Red(), Blue()))

As the variable is set to 0 the colouring is based on the count column. But as soon as the button is pushed for the colour change it reverts to red.

anthonyj_0-1635478167744.pnganthonyj_1-1635478186005.png

 

I hope this gives some ideas as to how it may be done.

Thanks

Anthony

dia2021
Creator
Creator
Author

Hi @anthonyj, Thanks for the suggestion!

I have a question: Can this be done using one button. By clicking on the button, it shows red, and then clicking again, it changes back to the original. 

Best,

anthonyj
Creator III
Creator III

Hi @dia2021 ,

Yes you absolutely can set this in one button.

Now, I have used a button as a KPI in this instance so I could use colour by expression rather than the set limits in the KPI object. I just put the measure in the label under General.

anthonyj_2-1635717058448.png

 

anthonyj_4-1635717144907.png

 

So, under the Font colour by expression, I used this condition.

=if($(vColourChange) = 1, red(),
if(count(Column) > 3, green(), red()))

I then added a standard button from the visualisations and in the Actions and navigation chose the action "Set variable value". The variable is vColourChange.

Under the value I added this condition.

=if( $(vColourChange) = 1, 0, 1)

To add more clarity behind the action button, I made the label dynamic depending on the intended action if pushed. This is under General >> Label.

=if($(vColourChange)=0, 'Change to Red', 'Reset')

I hope this helps in your dashboard.

Thanks

Anthony

dia2021
Creator
Creator
Author

Thanks, @anthonyj! It worked like a charm!