Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 yzhang88
		
			yzhang88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All, can someone help me to figure out the expression in Background Color section? I want to get something like this
So I create a histogram to show the distribution of sales for each customer. In dimensions, I use calculated dimension, class(aggr(sum(sales),customerID), 1000). The measurement/expression is count(distinct customerID). Then I got a histogram like above, now I want to show in histogram that x-axis value <5000 with red, otherwise green. Can someone help me with the expression in Background Color?
for example: IF (aggr(sum(sales),customerID)<5000, red(), green()) --this expression doesn't work
Thanks.
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		dont think additional aggr would work as you have bucketed it already.
i am assuming you want to mark each bucket where sum(Sales) for each customer is less than 5000
one work around would be to calculate average sale prize for each bucket which should satisfy the condition you want. something like
if(sum(Sales)/count(DISTINCT Customer)<5000,red(),green())
hope it works out
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		can you share a sample app?
 yzhang88
		
			yzhang88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Sorry, I think I can't due to company policy. Any questions I can answer?
 
					
				
		
 sergio0592
		
			sergio0592
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Scrambling option available in Document properties/Scrambling.
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		dont think additional aggr would work as you have bucketed it already.
i am assuming you want to mark each bucket where sum(Sales) for each customer is less than 5000
one work around would be to calculate average sale prize for each bucket which should satisfy the condition you want. something like
if(sum(Sales)/count(DISTINCT Customer)<5000,red(),green())
hope it works out
 yzhang88
		
			yzhang88
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This workaround looks working for my purpose. Thank you Dilip.
 dplr-rn
		
			dplr-rn
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		no problem. glad it worked out
