Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ziabobaz
Contributor II

RANK for negative and positive numbers for colormix2

Hi!

I want to color column in a table based on SIGN and VALUE using Colormix2.

I can't figure out how to calculate Rank for negative numbers and No of rows where values are Negative and Positive. All this values are inputs for Colormix2 function.

Please help

Screenshot_2.jpg

Labels (2)
4 Replies
ziabobaz
Contributor II

Re: RANK for negative and positive numbers for colormix2

Having slept with this over the night, worked out the solution

 

colormix1(
   rank(total fabs(column(X)))/NoOfRows(total),
      if(column(X)>0,green(),red()),white()
)

Cheers

Highlighted
vikasmahajan
Esteemed Contributor

Re: RANK for negative and positive numbers for colormix2

PFA

 

Vikas

ziabobaz
Contributor II

Re: RANK for negative and positive numbers for colormix2

thank you, but this does not take into account that positives should be gradient green and negatives - gradient red, with zero as white. I have posted the solution above and it works 

ziabobaz
Contributor II

Re: RANK for negative and positive numbers for colormix2

correction - it seems that Colormix1 does not support IF inside the function

if(column(1)>0,colormix1(
rank(total fabs(column(1)))/NoOfRows(total),
green(),white()
),


colormix1(
rank(total fabs(column(1)))/NoOfRows(total),
red(),white())

)