Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi,
Can someone please help me out to change the below function using set analysis.
SUM(AGGR((IF(A='1' OR B='1' OR C='1',SALES)), OP, PER)) /
SUM(AGGR((IF(A='1' OR B='1' OR C='1',VOLUME)), OP, PER)))
Thanks
 
					
				
		
If anyone has some suggestions, please let me know.
 
					
				
		
 johnw
		
			johnw
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Maybe this, but I'm not very confident in it without some data to play with:
sum(aggr(only({<A={'1'}>+<B={'1'}>+<C={'1'}>} SALES ),OP,PER))
/sum(aggr(only({<A={'1'}>+<B={'1'}>+<C={'1'}>} VOLUME),OP,PER))
It might even require something like this:
sum({<A={'1'}>+<B={'1'}>+<C={'1'}>} aggr(only({<A={'1'}>+<B={'1'}>+<C={'1'}>} SALES ),OP,PER))
/sum({<A={'1'}>+<B={'1'}>+<C={'1'}>} aggr(only({<A={'1'}>+<B={'1'}>+<C={'1'}>} VOLUME),OP,PER))
 
					
				
		
Thanks John. You code was excellent and made our day.
I was looking at the forum for long time and didn't find any solution with aggr / or combination.
Thanks.for your time and appreciate your help.
 
					
				
		
 johnw
		
			johnw
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Out of curiousity and to help others who may happen upon this thread, which version of the code worked, or did it take some further modification?
 
					
				
		
Your first expression worked as expected.
sum(aggr(only({<A={'1'}>+<B={'1'}>+<C={'1'}>} SALES ),OP,PER))
/sum(aggr(only({<A={'1'}>+<B={'1'}>+<C={'1'}>} VOLUME),OP,PER))
Thanks.
