
Re: help on ColorMix1 function
Gysbert Wassenaar Apr 15, 2015 8:50 AM (in response to Harika Kummara)Try this:
ColorMix1 ((1+Sign(2*(sum({<CustomerCountry=>}Sales)RangeMin (top(total sum({<CustomerCountry=>}Sales),1,NoOfRows(total))))/(RangeMax (top(total sum({<CustomerCountry=>}Sales),1,NoOfRows(total)))RangeMin (top(total sum({<CustomerCountry=>}Sales),1,NoOfRows(total))))1)*Sqrt(Fabs((2*(sum({<CustomerCountry=>}Sales)RangeMin (top(total sum({<CustomerCountry=>}Sales),1,NoOfRows(total))))/(RangeMax (top(total sum({<CustomerCountry=>}Sales),1,NoOfRows(total)))RangeMin (top(total sum({<CustomerCountry=>}Sales),1,NoOfRows(total))))1))))/2, cBad,cGood)

Re: help on ColorMix1 function
Harika Kummara Apr 15, 2015 9:14 AM (in response to Gysbert Wassenaar )Hi Gysbert,
Thank you for your quick response. After i use your formula the chart stopped responding and even I am unable to go further to other customer countries.
To be more precise I am attaching sample qvw with both the pie charts on place.
When ever i try to select single Customer or Customer Country the color is black.
Regards,
Harika

ColorMix.qvw 240.0 K

Re: help on ColorMix1 function
Gysbert Wassenaar Apr 15, 2015 9:55 AM (in response to Harika Kummara)You're using dimension limits to show only the first five and group the rest as Other. I don't have a solution to handle such a use case. Once you select one value the colormix function won't work anymore because there's only one value of sum(Sales) left to calculate with.

Re: help on ColorMix1 function
Harika Kummara Apr 16, 2015 12:32 AM (in response to Gysbert Wassenaar )Thank you for the explanation Gysbert, Now i understand why it is getting failed.
I have added an If condition to avoid black color and I have given a blue color which is more meaningful as the color between Legend and graph matched perfectly.
if(isnull(ColorMix1 ((1+Sign(2*(sum(Sales)RangeMin (top(total sum(Sales),1,NoOfRows(total))))/(RangeMax (top(total sum(Sales),1,NoOfRows(total)))RangeMin (top(total sum(Sales),1,NoOfRows(total))))1)*Sqrt(Fabs((2*(sum(Sales)RangeMin (top(total sum(Sales),1,NoOfRows(total))))/(RangeMax (top(total sum(Sales),1,NoOfRows(total)))RangeMin (top(total sum(Sales),1,NoOfRows(total))))1))))/2, cBad,cGood)),
RGB(141,170,203),
ColorMix1 ((1+Sign(2*(sum(Sales)RangeMin (top(total sum(Sales),1,NoOfRows(total))))/(RangeMax (top(total sum(Sales),1,NoOfRows(total)))RangeMin (top(total sum(Sales),1,NoOfRows(total))))1)*Sqrt(Fabs((2*(sum(Sales)RangeMin (top(total sum(Sales),1,NoOfRows(total))))/(RangeMax (top(total sum(Sales),1,NoOfRows(total)))RangeMin (top(total sum(Sales),1,NoOfRows(total))))1))))/2, cBad,cGood))
Regards,
Harika


