Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
i want to calculate the following scenario...
ID Amount
1 10
1 10
1 10
2 20
2 20
3 30
3 30
3 30
3 30
i want to group by id and calculate average of amount at script level.
Utsav
hi try this
a:
LOAD * INLINE [
id, amount
1, 10
1, 10
1, 10
2, 20
2, 20
3, 30
3, 30
3, 30
3, 30
];
LOAD
Avg(amount)as avg_amount
Resident a
Group by id;
hope it helps
hi
try this
LOAD id,sum(amount) as sumamount,
avg(amount) as avgamount
FROM
(ooxml, embedded labels, table is Sheet1) Group by id;
utsav u can do it in ui level very easily ....
Juast by takinmg your id as dimention ..
hi try this
a:
LOAD * INLINE [
id, amount
1, 10
1, 10
1, 10
2, 20
2, 20
3, 30
3, 30
3, 30
3, 30
];
LOAD
Avg(amount)as avg_amount
Resident a
Group by id;
hope it helps
Aggr function works for that
aggr(avg(Amount),Id)