Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
paulyeo11
Valued Contributor II

How to make my chart appear 3 color ? Now only 2 color

Hi All

Now my Bar chart if more then 30% it turn light Blue. below 30% bar color Blue.

Now i like to make 2013 Bar now Blue change to red color ? when GP % below 20% Bar color change to red.

I will enclosed my QV Doc in my next posting

Paul

1 Solution

Accepted Solutions

Re: How to make my chart appear 3 color ? Now only 2 color

Hi,

Due to Size of the file, i could not upload. But i just updated the above mentioned expression in the Background of Sales expression//

Capture.JPG

26 Replies

Re: How to make my chart appear 3 color ? Now only 2 color

May be this one

If(GP% <= 0.2 and Year=2013, RGB(255,0,0),

  If(GP% > 0.3,rgb(0,128,0)

  ,If(GP% < 0.15, RGB(255,255,98), RGB(0,255,0))

  ))

paulyeo11
Valued Contributor II

Re: How to make my chart appear 3 color ? Now only 2 color

Hi Sir

Thank you for your sharing.

After I play round your script , it work fine. Since my condition is only 2 :-

GP % > 30 % yellow

GP % < 20 % Red

GP % between 20 % to 30 % Green

It is possible for you modify the expression to allow me enter only 2 value .

As now your script allow me enter 3 value.

Paul

Sent from my iPhone

Re: How to make my chart appear 3 color ? Now only 2 color

Try this..

If(GP% > 0.3,Yellow()

  ,If(GP% < 0.2, Red(), Green())

  )

Don't you want include your Year field? In the first thread you mentioned, if year =2013, you need blue bar..

paulyeo11
Valued Contributor II

Re: How to make my chart appear 3 color ? Now only 2 color

Hi Settu

I just try your script , all bar display blue Color .

I don't need add year =2013 as condition.

Paul

Sent from my iPhone

Re: How to make my chart appear 3 color ? Now only 2 color

Hi Paul,

What about your selections? I don't see the blue color bar..

see the snap shot.

Picture1.jpg

paulyeo11
Valued Contributor II

Re: How to make my chart appear 3 color ? Now only 2 color

Hi Settu

Can you send me the QV file ?

Paul

Sent from my iPhone

Re: How to make my chart appear 3 color ? Now only 2 color

Hi,

Due to Size of the file, i could not upload. But i just updated the above mentioned expression in the Background of Sales expression//

Capture.JPG

paulyeo11
Valued Contributor II

Re: How to make my chart appear 3 color ? Now only 2 color

Hi Settu

I think I know why , my mistake most likely is due to I shortage of one ) on the middle row of the script at the end .

Will test it

Paul

Sent from my iPhone

paulyeo11
Valued Contributor II

Re: How to make my chart appear 3 color ? Now only 2 color

Hi Settu

Many thank , it work fine now. Very nice scripting

Paul

Sent from my iPhone

Community Browser