Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hello everyone. I am having trouble getting the syntax right in my load script. Here is what I have:
SUM(IF(SO_AD_SEG_MET.w_prd_dt='2016-04-01',SO_AD_SEG_MET.metric_value)) AS test
What is wrong with this syntax, please?
 
					
				
		
 Mark_Little
		
			Mark_Little
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
what is the error you are getting.
As you are doing aggregate you probably need to add a group by after your load or resident.
Mark
 
					
				
		
 vishsaggi
		
			vishsaggi
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Are you writing this aggregation as an SQL statement. Did you use Group By clause in the end ?
LOAD
*;
SQL SELECT
col1,
col2,
SUM(IF(SO_AD_SEG_MET.w_prd_dt='2016-04-01',SO_AD_SEG_MET.metric_value)) AS test
FROM SO_AD_SEG_MET
GROUP BY Col1, Col2......
Something like this. Can you post the whole script statement you are using and the error you are getting?
V.
 
					
				
		
 Mark_Little
		
			Mark_Little
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
what is the error you are getting.
As you are doing aggregate you probably need to add a group by after your load or resident.
Mark
 
					
				
		
I am trying to accomplish this sum-if in the load statement. Is that not possible?
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Syntax doesn't seem to be wrong, what is the error you are getting? Have you made sure to add the Group by statement as mentioned by vishsaggi above?
 sunny_talwar
		
			sunny_talwar
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		It is possible, what is the script for the whole table? and what error are you getting?
 
					
				
		
what is your result?
check the dateformat of SO_AD_SEG_MET.w_prd_dt
 
					
				
		
I did need to use aggregation (a group by).  Thank you 
