
Re: How to calculate average over a range of data?
Alluraiah Allu Sep 13, 2016 11:23 AM (in response to Apoorva SD)Hi
Following will help for determining a DAY (like from 8 AM TO 8 PM) ??
with this hope you can go with Average ..!!?
Solution given by Andres

Re: How to calculate average over a range of data?
Apoorva SD Sep 14, 2016 1:47 AM (in response to Alluraiah Allu)Hello,
Thank you for the suggestion.
Expression in that thread determines DAY. But my requirement is to filter the "Time" values between 8 AM to 8 PM and then take the average of licenses used within that Time frame per day.
Any other idea?
Thank you.


Re: How to calculate average over a range of data?
Marco Wedel Sep 13, 2016 4:32 PM (in response to Apoorva SD)Hi,
you could select 8 AM to 8 PM in a list box of your time field or restrict your Avg() function to this interval using a set expression.
regards
Marco

Re: How to calculate average over a range of data?
Apoorva SD Sep 14, 2016 1:40 AM (in response to Marco Wedel )Hi Marco,
Thank you for the suggestion.
But i don't want to select time separately from the list box. I would like to implement that filter in my graph itself.
Any other suggestion?
Thank you.


Re: How to calculate average over a range of data?
Stefan Wühl Sep 13, 2016 4:41 PM (in response to Apoorva SD)Maybe something like
=Avg( If(Hour(TIME) >=8 AND Hour(TIME) <=20, USAGE))
or
=Avg({<TIME = {">='08:00 AM'<='08:00 PM'"}>} USAGE)
for example in a chart with dimension DATE, to get the avg USAGE in your time slots.
(Finding the right format for your numeric search in the set analysis might be a bit difficult)

Re: How to calculate average over a range of data?
Apoorva SD Sep 14, 2016 1:19 AM (in response to Stefan Wühl )Hello Stefan,
Thank you for the suggestion.
I tried both the expressions. 1st expression isn't filtering the data between 8 AM to 8 PM. Average still shows for the entire 24 hours (which is dropping the average by 50%)
for ex: if the average utilization of license for time period 8 AM to 8 PM is 32, my graph displays 16 (because it it considering entire 24 hours).
And the 2nd expression is not working.
Any further suggestions?
Thank you.

Re: How to calculate average over a range of data?
Stefan Wühl Sep 14, 2016 12:02 PM (in response to Apoorva SD)Please describe your data model / tables a bit closer, and maybe add some sample records and your expect result.

Re: How to calculate average over a range of data?
Apoorva SD Sep 15, 2016 3:58 AM (in response to Stefan Wühl )




Re: How to calculate average over a range of data?
sasi k Sep 14, 2016 2:19 AM (in response to Apoorva SD)Try Something like,
Var Start=num('08:00:00 AM')
Var End=num('08:00:00 PM')
load *,Num(Time( Time_Field)) as Time from Table;
Exp : AVG(AGGR(Count(If(Time>Start and Time<End,LICENCENO)),Day))
May be helpful

Re: How to calculate average over a range of data?
Apoorva SD Sep 14, 2016 4:18 AM (in response to sasi k)Hi Sasi,
Thank you.
But its not working. I can't see the data for the average in my graph.

Re: How to calculate average over a range of data?
sasi k Sep 15, 2016 1:43 AM (in response to Apoorva SD)Please try to share some sample data ,it would be helpful

