Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
elizabeth__
Contributor III
Contributor III

Custom Color Gradient in Treemap

Hello all,

I have a treemap that I want to add a (measure-based) color gradient to beside the Qlik ones of orange and blue. I want it to be red for larger measure values and green for lower measure values. Is there a way to achieve this with an expression?

Thanks

Labels (1)
1 Solution

Accepted Solutions
Channa
Specialist III
Specialist III

try 

colormax1

sample

ColorMix1 ((1+Sign(2*(rangemin(5000000,rangemax(sum(CUSTOMS_VALUE_QAR),1000))-1000)/(5000000-1000)-1)*Sqrt(Fabs((2*(rangemin(5000000,rangemax(sum(CUSTOMS_VALUE_QAR),1000))-1000)/(5000000-1000)-1))))/2, ARGB(255, 19, 236, 160), ARGB(255, 35, 75, 1))

 

measure:CUSTOMS_VALUE_QAR

highvalue:5000000

lowvalue;1000

Channa

View solution in original post

3 Replies
santho_ak
Partner - Creator III
Partner - Creator III

Attached screenshot for your reference. Write custom expression based on your requirement.

c1.JPG

Channa
Specialist III
Specialist III

try 

colormax1

sample

ColorMix1 ((1+Sign(2*(rangemin(5000000,rangemax(sum(CUSTOMS_VALUE_QAR),1000))-1000)/(5000000-1000)-1)*Sqrt(Fabs((2*(rangemin(5000000,rangemax(sum(CUSTOMS_VALUE_QAR),1000))-1000)/(5000000-1000)-1))))/2, ARGB(255, 19, 236, 160), ARGB(255, 35, 75, 1))

 

measure:CUSTOMS_VALUE_QAR

highvalue:5000000

lowvalue;1000

Channa
AdityaAgarwal
Contributor
Contributor

I am getting the error "Nested aggregation not allowed" Can someone help me?

 

=ColorMix1 ((1+Sign(2*(rangemin(250000,rangemax(sum(($(v_SalesFST)/ $(v_SalesFST_Comp) ) -1),185000))-185000)/(250000-185000)-1)*Sqrt(Fabs((2*(rangemin(250000,rangemax(sum(($(v_SalesFST)/ $(v_SalesFST_Comp) ) -1),185000))-185000)/(250000-185000)-1))))/2, ARGB(255, 19, 236, 160), ARGB(255, 35, 75, 1))

 

high value_250000
LowValue_185000