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: 
nikhilgarg
Specialist II
Specialist II

Color Code not working correct in QlikSense

Hello All,

I am using "Simple KPI Extension" object. In that i am calculating a measure named "Diff".Pls refer attached image "Difference.png"

I have used a color code expression to show Diff value in red if <0 and in Green if >0. Pls refer the attached image named as "Color Code.png". But my negative values are being shown in Green only and not in red. My expression is correct but no idea why it is behaving so. Can anyone help on this?

Thanks,

Nikhil Garg

30 Replies
mdmukramali
Specialist III
Specialist III

Hi,

expression looks correct.

can you share the app .

saniyask
Creator
Creator

Hi,

This can sometimes happen because of placing of brackets, can you check with the below code.

if(((Sum(your exp)/10000)-(Sum(your exp)/10000))>0,Green(),Red())

Regards,

Saniya.

shraddha_g
Partner - Master III
Partner - Master III

Share sample app..

Else try to do it first in table and then add it to chart

nikhilgarg
Specialist II
Specialist II
Author

Hey ,

I tried your way but also didnt worked. Pls find below expression:

if(((Sum({<[Transaction Type] = {'Sales'}, Year = {$(vCurYear)}, MonthNumber = {"<=$(=vCurMonth)"}>}Amount)/10000)

-

(Sum({<[Transaction Type] = {'Sales'}, Year = {$(vPrevYear)}, MonthNumber = {"<=$(=vCurMonth)"}>}Amount)/10000))> 0,Green(),Red())

nikhilgarg
Specialist II
Specialist II
Author

Hey,

and it works for staright table but not for Simple KPI ObjectI tried the same in staright table as well. Used same expression for background color but not for Simple KPI Object. Pls find attached snapshot.

shraddha_g
Partner - Master III
Partner - Master III

In which chart you are trying this expression?

nikhilgarg
Specialist II
Specialist II
Author

I ahve taken the extension "Simple KPI Object" where color code not working.

Then i tried to implement the same color code expression(as background expression) in "Straight Table" and it works fine. It is not working fine in Simple KPI Object Extension

shraddha_g
Partner - Master III
Partner - Master III

try using hex colors in expression

nikhilgarg
Specialist II
Specialist II
Author

Well, i can try dat also but i guess when rgb() for green working then it should work for red as well.

Wat Say?