Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
Hi, how can I sum the values group by store? My current table is as such:
| Store | Value | 
|---|---|
| A | 2 | 
| A | 6 | 
| A | 8 | 
| B | 1 | 
| B | 7 | 
| B | 3 | 
| C | 9 | 
| C | 2 | 
| C | 8 | 
How can I create this table? :
| Store | Value | 
|---|---|
| A | 16 | 
| B | 11 | 
| C | 19 | 
Thanks.
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
If you want to do this in script then try like this
Data:
LOAD Store,
Sum(Value) AS Value
FROM DataSource
GROUP BY Store;
If you want to achieve this in chart
Dimension: Store
Expression: Sum(Value)
Hope this helps you.
Regards,
Jagan.
 
					
				
		
Hi ,
Try Like this :
Load Store ,sum(Value) from [table name] group by Store;
Thanks !!
 
					
				
		
 ecolomer
		
			ecolomer
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		See this
 
					
				
		
 jagan
		
			jagan
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
If you want to do this in script then try like this
Data:
LOAD Store,
Sum(Value) AS Value
FROM DataSource
GROUP BY Store;
If you want to achieve this in chart
Dimension: Store
Expression: Sum(Value)
Hope this helps you.
Regards,
Jagan.
 
					
				
		
Thanks. May I ask why is this an invalid expression? :
load *,
sum(Value) as [Value (S$)]
Resident FinalTable group by Store;
 
					
				
		
bcz u have mention * .
* means All and u r using value as twice .
Thanks !!
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi
If you use a group by clause, you must explicitly list all the fields not in aggregate functions. Since you have specified * (which is implictly all fields in the table), you will need to include all of these fields in the group by clause.
Otherwise, use
load Store,
sum(Value) as [Value (S$)]
Resident FinalTable group by Store;
HTH
Jonathan
