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: 
jmialoundama
Specialist
Specialist

CSS with object Multi KPI

Hello,

I am using Qlik Sense multi KPI object.

Here is my CSS code:

& *{
border-width: 2px;
border-color: #E6E6EF;
}

& .label * {
font-family: 'Calibri';
font-size: 150%;
}

& .statistic-1 .value * {
font-family: 'Calibri';
font-size: 150%;
}

& .value * {
font-family: 'Calibri';
font-size: 90%;
}


I have 4 squares. I want to put a conditional color on each of the squares.
How can I achieve it in CSS.

Here are the colors I want to use:
If Alert then green
If Critical then red
If command to launch then Orange
Otherwise Grey.

jmialoundama_0-1676305971705.png

Thanks in advance 🙂

Labels (1)
10 Replies
deepanshuSh
Creator III
Creator III

What do you mean by conditional colors? what are the conditions that you are trying to showcase here? 

What I understand is that you are trying to give colors to these button which can be directly done using the background expression editor and font color by expression.

Trial and error is the key to get unexpected results.
jmialoundama
Specialist
Specialist
Author

Hi @deepanshuSh , 

 

Thanks for your return.

I tried to put an expression on the text according to what the text shows me at this level, but it does not work:

jmialoundama_0-1676312202370.png

 

I use this object on Qlik : 

jmialoundama_1-1676312243231.png

 


So I thought I could do it in CSS

vinieme12
Champion III
Champion III

It is NOT POSSIBLE to use CSS to check VALUES / TEXT on a page

Switch to using the KPI object if possible as it allows conditional colors

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
jmialoundama
Specialist
Specialist
Author

Hello @vinieme12 , 

With the KPI object it is possible to put colors by expression only if it is a number.
If the KPI contains text it is not possible to put a color by expression

vinieme12
Champion III
Champion III

Well your Threshold Values based on which you decide if its an Alert, Critical and Command are numbers correct??

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Sylvain1
Contributor II
Contributor II

Bonjour,

 

avez vous trouvé une solution, j'ai le même problème et je ne parviens pas a utiliser une couleur conditionnelle comme c'est possible sur un sipmle KPI.

 

Merci

deepanshuSh
Creator III
Creator III

What exactly is the requirement, please be detailed. And use english for better understanding. 

Trial and error is the key to get unexpected results.
Sylvain1
Contributor II
Contributor II

Hi,

Sorry I posted in french because the first topic was posted by a french guy 🙂

I think I have the same problem as him, I try to use conditionnal coloring measure within a multikpi object.

In the configuration panel we have the opiion to use conditionnal value but impossile to configure it in the same way as other objects:

conditionnal value enable (no field (Fx) to configure it):

Sylvain1_2-1690532824584.png

 

Conditionnal value disable (tou can choose the fixed color) :Sylvain1_1-1690532774266.png

 

So My question is do you know how to create a conditonnal color on a measure  value on multikpi?

 

Thanks for you help

 

deepanshuSh
Creator III
Creator III

I dont see this option in the working, you can try by creating the master dimension if that works...in my case it didnt. Instead I have used a text and image and button to get the desired result.

Trial and error is the key to get unexpected results.