Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rammuthiah
Creator III
Creator III

Gauge chart color code based on if condition - Qlik Sense

I have calculated dimension, I want to show colour based on condition,

if Calculated value > than 0.80, colour should be green()

if Calculated value < than 0.80, colour should be red()


Also, How to give range and limits using segments?

1 Solution

Accepted Solutions
caio_caminoski
Creator
Creator

Hi Ram,

so, following the images I sent before you would have sth like:

First Dimention

=1 (or any text you would like)

Second Dimentions

=Valuelist(1, 2) (or any two names you would like

Measure:

if( valuelist(1,2)=1

     ,[Your Expression that returns a number between 0 and 1]

    , 1 - [Your Expression that returns a number between 0 and 1]

    )

Color Expression:

if( (valuelist(1,2)=1) and ([Your Expression that returns a number between 0 and 1]<0.8)

     , Red()

     ,if( valuelist(1,2)=1

          ,Green()

         ,LightGray()

    )

)

View solution in original post

11 Replies
viveksingh
Creator III
Creator III

You have to select USE SEGMENTS option under appearance tab. and add Limits and select colors.

for your scenario add one limit and value it to 0.80 and select color as Green

the other color as Red. so if the value falls above 0.80 that will shows as red

rammuthiah
Creator III
Creator III
Author

In my case, Range is like 0 - 1. My calculated value is 0.73, So the color should be like for upto 0.73 it should be red because of not reached target 0.8. the remaining range should be grey colour

gauge red.png  

If it reaches 0.8, then the colour should be green, the remaining range should be grey colour

gauge green.png

rammuthiah
Creator III
Creator III
Author

In my case, Range is like 0 - 1. My calculated value is 0.73, So the color should be like for upto 0.73 it should be red because of not reached target 0.8. the remaining range should be grey colour

gauge red.png 

If it reaches 0.8, then the colour should be green, the remaining range should be grey colour

gauge green.png

viveksingh
Creator III
Creator III

Then use two limits.

1st limit upto 0.73

2nd limit upto 0.83

and final will be gray

caio_caminoski
Creator
Creator

rammuthiah
Creator III
Creator III
Author

Likewise, In Qlik Sense, is there anything to do?

caio_caminoski
Creator
Creator

My bad, I miss that it was about qlik sense.

So, I am not sure if you can apply conditional colour in the native gauge chart of qlik sense. If you can't, I would try to do a bar chart and play with calculated dimensions.

It is not sth I would liket to do a lot, specially with a big data set, but if you really need it and don't intend to use an extension, maybe you could do it.

Ex:

Captura.PNG

The first dimension is a plain text. The second one is a value list. The first one represents your expression and the second the gray area.

After that you may be able to work with the conditional for the value list equals to your expression area

Captura1.PNG

Than you can hide axes and make it look better.

It is not an amazing solution but may work for what you want.

Cheers,

Caio

rammuthiah
Creator III
Creator III
Author

Thanks Caio,

According to my requirement, if Mycount is greater than 0.8 -> green color, (i.e) if Mycount value is 0.73, then 0-0.73 should be in red and if Mycount value is 0.85, then 0-0.85 should be in green. Rest(not completed) upto

1 (Mycount value[0.73 or 0.85] to 1)should be in grey colour.

rammuthiah
Creator III
Creator III
Author

It's working as per my requirement, but Is there anyway to show the rest in grey colour