Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

nikhilgarg
Contributor III

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
Valued Contributor II

Re: Color Code not working correct in QlikSense

Hi,

expression looks correct.

can you share the app .

saniyask
Contributor

Re: Color Code not working correct in QlikSense

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
Honored Contributor III

Re: Color Code not working correct in QlikSense

Share sample app..

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

nikhilgarg
Contributor III

Re: Color Code not working correct in QlikSense

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
Contributor III

Re: Color Code not working correct in QlikSense

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
Honored Contributor III

Re: Color Code not working correct in QlikSense

In which chart you are trying this expression?

nikhilgarg
Contributor III

Re: Color Code not working correct in QlikSense

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
Honored Contributor III

Re: Color Code not working correct in QlikSense

try using hex colors in expression

nikhilgarg
Contributor III

Re: Color Code not working correct in QlikSense

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

Wat Say?