Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
ziabobaz
Creator III
Creator III

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)
1 Solution

Accepted Solutions
ziabobaz
Creator III
Creator III
Author

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())

)


View solution in original post

4 Replies
ziabobaz
Creator III
Creator III
Author

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

vikasmahajan

PFA

 

Vikas

ziabobaz
Creator III
Creator III
Author

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
Creator III
Creator III
Author

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())

)


View solution in original post