Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
Its simple but I am missing a hook.Not sure what wrong I am doing.Please khelp me here.
I have table with ID,Cost and People
ID Cost People
1 10000 20
2 20000 10
3 30000 10
Here I have to calculate Cost per person
Tabl1:
Load
ID,
Cost,
People
from Table name;
Load ,
ID,
Sum(Cost)/sum(People) as Cost/Person
Resident Tabl1
GROUP BY ID;
I am not getting the exact output for Cost/Person.Not sure what is wrong here.Can somebody point at the mistake I am doing ?
Thanks much
What are you getting and what do you expect to get?
it seems ok to me
Tabl1:
load * inline [
ID, Cost , People
1 , 10000, 20
2 , 20000, 10
3 , 30000, 10
];
Load
ID,
Sum(Cost)/sum(People) as [Cost/Person]
Resident Tabl1
GROUP BY ID;