Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
hi All
Could you please confirm whether the below given expression is accurate
sum(If(Sales='0',Planned,Sales))
Month Sales, Planned
Jun 100 100
Jul 150 100
Aug 0 200
Based on above sample data, i would like to calculate cumulative sales for 3 months
Sum all sales but if sales is equal to zero , then planned value should be aggregated
Thus , total value for three months should 100+150+200 = 450
BR
Jayanthan
 
					
				
		
 MarcoWedel
		
			MarcoWedel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I guess you're looking for IsNull(Sales) rather than Sales=0:

hope this helps
regards
Marco
 
					
				
		
 ecolomer
		
			ecolomer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I think the easiest thing would be to create a new field that contains or Planned Sales, Sales according to either = 0 or not.
Then this calculated field new
 
					
				
		
 israrkhan
		
			israrkhan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		try like
if(sum(Sales=0), sum(Planned), sum(Sales))
 
					
				
		
 mdmukramali
		
			mdmukramali
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Dear ,
Sales:
load * Inline
[
Month,Sales,Planned
Jun,100,100
Jul,150,100
Aug,0,200
];
LOAD * ,
if(Sales=0,Planned,Sales) as Sales_planned
Resident Sales;
DROP Table Sales;

Thanks.
 
					
				
		
 MarcoWedel
		
			MarcoWedel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		sum(If(Sales=0,Planned,Sales))
Should work.
Regards
Marco
 
					
				
		
hi all
it doesn not work
BR
Jayanthan
 
					
				
		
 MarcoWedel
		
			MarcoWedel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Please post sample APP/data
 
					
				
		
Hi Macro
Please find QVW and data source
Jayanthan
 ashfaq_haseeb
		
			ashfaq_haseeb
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
It works as expected.
What are you trying to achieve here.
Can you post your required output .
Regards
ASHFAQ
 
					
				
		
 MarcoWedel
		
			MarcoWedel
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I guess you're looking for IsNull(Sales) rather than Sales=0:

hope this helps
regards
Marco
