Joined: 30 Jan 2013
Online Status: Offline
Posts: 12
Topic: Average of a summarized formula field Posted: 06 May 2013 at 10:21am
Hi,
I would like to know how to get the average of a summarized field. For example. I have a count field of "total_Records" which is string. I would like to get the average of this amount based on business days.
I feel it is not a simple average function as the business days condition involved. I Appreciate any helpful hand to sort out this.
Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Posted: 06 May 2013 at 11:02am
well, if it is not a simple average, I would create my own running total using variables, though you might be able to accomplish this using Running Totals...but they are DBlanks forte.
for variables, you typically have 3 sets of formulas:
initialize/reset, usually in a group header:
shared numbervar x:=0;
"" // this will hide the 0 zero on the report
a summary value, usually in a group footer;
shared numbervar x;
x
so far, pretty easy...now the hardest one, which might be simple
in the detail section, the accumulator
shared numbervar x;
if {table.field} then
x := x +1;
"" //again will hide the running value.
now the question is what to put in the 'if' statement...
I would try the DayOfWeek() function and do something like this:
if DayOfWeek({table.field}) > 1 and DayOfWeek({table.field}) < 7 then
x := x + 1;
""
this should you a count of weekdays, that you can then use to figure out your average.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum