Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I'm having issues with my average calculation using time and volumes
Time Volumes
01:00:00 4
01:00:00 3
01:00:00 2
01:00:00 4
01:00:00 5
03:30:00 2
03:30:00 2
03:30:00 3
03:30:00 4
=Sum(VOLUME) / Count( [Time])
For 01:00 I would want to return an average of 3.6
For 03:30 I want to return an average of 2.75
The issue seems to be with the count section of my expression, it's counting the total value of time instead of the entries.
Just do Avg(Volumes)
I've added the above expression to my pivot table but it's still not showing me the correct average.
It's seem to be trying to count the value of my time instead of the amount of entries for that specific time
read this post
try with the TOTAL keyword
either
=Sum(VOLUME) / Count( TOTAL [Time])
or
Sum(VOLUME) / Count( TOTAL <[Time]> [Time])
Try this in front end
aggr(Avg(Volumes),Time)
Why not?
Hi in script it would be like:
temp:
LOAD * INLINE [
Time,Volumes
01:00:00,4
01:00:00,3
01:00:00,2
01:00:00,4
01:00:00,5
03:30:00,2
03:30:00,2
03:30:00,3
03:30:00,4
];
NoConcatenate
table:
load
Time,
avg(Volumes) as AvgByTime
Resident temp
Group by Time;
drop table temp;