Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 abhaysingh
		
			abhaysingh
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HI Guys,
HOw can I put below expression in Set Analysis?
=if([Category Name]='Beer',sum(Quantity)/24,sum(Quantity)/12)
thanks
Abhay
 
					
				
		
 gautik92
		
			gautik92
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Sum({<[Category Name]='Beer'>}Quantity)/24,Sum({<[Category Name]='Beer'>}Quantity)/12
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I don't think this can be converted into a set analysis expression. Best you can do is this:
=Sum(Quantity)/If([Category Name] = 'Beer', 24, 12)
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Alternatively you can create a flag in a script:
Table
LOAD [Category Name],
Quantity,
OtherField
FROM Source
FlagTable:
LOAD Distinct [Category Name],
If([Category Name] = 'Beer', 24, 12) as Flag
Resident Table;
Expression:
Sum(Quantity)/Flag
 
					
				
		
 CELAMBARASAN
		
			CELAMBARASAN
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Try the Below one
RangeSum(sum({<[Category Name]='Beer'>}Quantity)/24,sum({<[Category Name]-='Beer'>}Quantity)/12)
Hope this helps
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Beautiful... This is very creative 
 
					
				
		
 mohammadkhatimi
		
			mohammadkhatimi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hie...
=sum({<[Category Name]={'Beer'}>}Quantity)/24+sum([Category Name]={'*'}-{'Beer'}Quantity)/12)
Hope this will helps you..!!
Regards,
Mohammad
