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: 
Not applicable

Colour code by expreesion

Hi all ,

does the following code is correct? not working actually

if(Status='Sanctioned But Not Disbursed',$(Blue),

if((Today-Date1)>=0 and (Today-Date1)<=1,$(Pink),

if((Today-Date1)>=2 and (Today-Date1)<=3,$(Yellow),

if((Today-Date1)>=4 and (Today-Date1)<=5,$(Green),

if((Today-Date1)>=6 and (Today-Date1)<=14,$(Blue),

if((Today-Date1)>=15 and (Today-Date1)<=30,$(Blue),

if((Today-Date1)>=31,$(Beige))))))))

Any Advice

Regards

Charlie

21 Replies
shraddha_g
Partner - Master III
Partner - Master III

Try to calculate this extension in Load script and use that in front end.

eg

if(Status='Sanctioned But Not Disbursed',

if((Today-Date1)>=0 and (Today-Date1)<=1, '0-1 Days',

if((Today-Date1)>=2 and (Today-Date1)<=3, '2-3 Days',

if((Today-Date1)>=4 and (Today-Date1)<=5, '4-5 Days',

if((Today-Date1)>=6 and (Today-Date1)<=14, '6-14 Days',

if((Today-Date1)>=15 and (Today-Date1)<=30, '15-30 Days',

if((Today-Date1)>=31, '>30 Days')))))))   as Bucket

in chart use Dimension as Bucket

in Color expression use

pick(wildmatch(Bucket,'0-1 Days','2-3 Days','4-5 Days', '6-14 Days', '15-30 Days','>30 Days'),

rgb1,

rgb2,

rgb3,

rgb4,

rgb5,

rgb6)

Not applicable
Author

extension is different question , and colour code is different question

i didnot understand , confused a bit , can u be a bit clear ,

Regards

Charlie

shraddha_g
Partner - Master III
Partner - Master III

For Measure you can use

sum(if(vCarry='C',Count,

if(vCarry='A',Amount/10000000)))

Not applicable
Author

I want the amount to be shown as in crore yaar,

Regards

Charlie

vinieme12
Champion III
Champion III

Can be rewritten as below, but what is Date1?? is it a number or a date or a string?

if(Status='Sanctioned But Not Disbursed',Blue()

,if((Today()-Date1)>=31,Rgb For Beige

,if((Today()-Date1)>=15,Blue()

,if((Today()-Date1)>=6,Blue()

,if((Today()-Date1)>=4,Green()

,if((Today()-Date1)>=2,Yellow()

))))))


Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
vinieme12
Champion III
Champion III

charlieon

You are trying to subtract a field Date1 which has multiple Date values, which is why the expression is failing, you can only subtract by one value by either choosing Min() or Max() Dates from that field

so try below, it worked for me

=if(Status='Sanctioned But Not Disbursed',$(Jana_Yellow)

,if((Today()-Max(Date1))>=31,$(Jana_Beige)

,if((Today()-Max(Date1))>=15,$(Jana_Light_Blue)

,if((Today()-Max(Date1))>=6,$(Jana_Dark_Blue)

,if((Today()-Max(Date1))>=4,$(Jana_Green)

,if((Today()-Max(Date1))>=2,$(Jana_Yellow),$(Jana_Pink)

))))))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Hi vineeth,

Thanks yaar .

Date1 is the date column in SourcingStatuswiseCount  table.


I ts working yaar but not completly ...


not all the colours are reflecting ..


any advice


Thanks& Regards

Charlie

vinieme12
Champion III
Champion III

i will check and let you know

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Not applicable
Author

Actually colours i mentioned random , but its not the sequence .

try with below if possible

  1. RGB(250, 165, 25) - #faa519
  2. rgb(255,180,10) - #ffb40a
  3. rgb(255,191,0) - #FFBF00
  4. rgb(255,182,193) - #FFB6C1
  5. rgb(199,21,133) - #C71585
  6. RGB(216, 16, 124) - #d8107c

or put one colour for one range yaar, try if u can please.

Thanks & Regards

charlie

vinieme12
Champion III
Champion III

Do you want to evaluate Today() - min(Date1) or today()-Max(Date1) ?? because your expression also needs to be updated

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.