Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

fredthered
New Contributor

Barchart showing incorrect color

This is my condition which i  am using for color by expression .If(DIFF_AMOUNT < 0,RGB(255,0,0),RGB(34,139,34))

However my graph shows a wrong color (ie green) in the -30 to -25 range, when in fact should be red.


IMAGE$2EBC5F24B2896FDF.jpg


Thanks in advance,

Cheers,

Tanay

Tags (1)
14 Replies
agigliotti
Honored Contributor II

Re: Barchart showing incorrect color

are you sure your measure is DIFF_AMOUNT ?

maybe is:

If( Sum(DIFF_AMOUNT) < 0,RGB(255,0,0),RGB(34,139,34) )

Hope it helps.

rangam_s
Contributor II

Re: Barchart showing incorrect color

In the below expression use complete measure expression instead of "DIFF_AMOUNT ", so that it will work based on bar value.

If(DIFF_AMOUNT < 0,RGB(255,0,0),RGB(34,139,34))

kaanerisen
Contributor III

Re: Barchart showing incorrect color

Hi Tanay,

If(left(DIFF_AMOUNT,1)='-',RGB(255,0,0),RGB(34,139,34))

fredthered
New Contributor

Re: Barchart showing incorrect color

Hi Andrea,

actually The measure is - Count (distinct [Property No])

To color the bar chart, I am just using color by expression and providing If(DIFF_AMOUNT_EMAIL < 0,RGB(255,0,0),RGB(34,139,34))

as the expression there.


fredthered
New Contributor

Re: Barchart showing incorrect color

Hi Rangam,

Tried it, but no luck there.

fredthered
New Contributor

Re: Barchart showing incorrect color

Hi Kaan ,

Still giving the same graph

rangam_s
Contributor II

Re: Barchart showing incorrect color

Try this

If((Count (distinct [Property No])<=0),RGB(255,0,0),RGB(34,139,34))


what is your dimension here?

fredthered
New Contributor

Re: Barchart showing incorrect color

my dimension is

Dual(Replace(class(DIFF_AMOUNT, 5),'<= x <', '-') ,class(DIFF_AMOUNT, 5))

rangam_s
Contributor II

Re: Barchart showing incorrect color

Looks like, you want color based on the dimension you have defined (i.e. ranges), so you need to try different approach not on measure.

You can try based on the value you have used for deriving those range dimensions.

Community Browser