Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

paulyeo11
Valued Contributor II

Convert 3 color script to 4 color for GP%

Hi All

After finish my work , i manage to think better and able to know what i want , So I think better i start a new posting , since my requirement have change.

I have the condition is below :- 

GP < 25 %  Color Red

GP <35 % >25% Green color

GP >35% Yellow

Mr Sutte give me the below script , which is working fine :-

If(GP% > 0.35,Yellow()

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

  )

 

Now I need to change the condition to add one more color for Organ :-

GP < 25 %  Color Red

GP <30 % >25% Organ color

GP <30 % >35% Green color

GP >35% Yellow

May i know how to modify the script for above new condition ?

I will post my QV sample in next posting.

Paul

1 Solution

Accepted Solutions

Re: Convert 3 color script to 4 color for GP%

Hi,

Try this expression.. (I don't have an idea about the Organ color, i just set as Blue(), you can change it)

If(GP% > 0.35,Yellow(),

  if(GP% > 0.3 and GP%<= 0.35,Green(),

  if(GP% >0.25 and GP% <= 0.3,Blue(),

  If(GP% <= 0.25, Red()))))


See the below screen shot, I selected the year as '2010'..

Capture.JPG


2 Replies

Re: Convert 3 color script to 4 color for GP%

Hi,

Try this expression.. (I don't have an idea about the Organ color, i just set as Blue(), you can change it)

If(GP% > 0.35,Yellow(),

  if(GP% > 0.3 and GP%<= 0.35,Green(),

  if(GP% >0.25 and GP% <= 0.3,Blue(),

  If(GP% <= 0.25, Red()))))


See the below screen shot, I selected the year as '2010'..

Capture.JPG


paulyeo11
Valued Contributor II

Re: Convert 3 color script to 4 color for GP%

Hi settu

I have try to modify the color code to get red color and light green and your script is what i need , thank you very much.

If(GP% > 0.36,Yellow(),

  if(GP% > 0.33 and GP%<= 0.36,RGB(0,255,0),

  if(GP% >0.3 and GP% <= 0.33,rgb(254,184,0),

  If(GP% <= 0.3, rgb(255,0,0)))))

Paul