avg rather than sum in demo 3.frf
canobob
Spain
Hi!
Can some one tell me why if I change the Sum for AVG in demo fr3 the memo28 on the sencond groupfooter (Band7) allway shows 0?
In my Application I have a report that does more or less the same as this report except that the values are AVG rather than SUM
Thank
Roberto
Can some one tell me why if I change the Sum for AVG in demo fr3 the memo28 on the sencond groupfooter (Band7) allway shows 0?
In my Application I have a report that does more or less the same as this report except that the values are AVG rather than SUM
Thank
Roberto
Comments
However please post questions about Fr3 in the Fr3 forum.
(IE: frdemo.EXE)
First Avg requires a band name parameter and second it must be in correct footer
so it would look like
[AVG(varname]*[varname,nameofmdband)] and be placed in the innergroup footer not the outerfooter since we are working with variables that have expression values belonging to the group
you could also use [AVG([parttotal],bandname)] and get the same result.
But ...Maybe is my English....
I know how to get the Avg in the inner group, my problem is getting the AVG for the outer.
to keep to the example FR3.FRF :
Let say that I need to get the Avg of the total sale of a customer in the outer band
next to "Total sales this customer: [Sum([Part total])]$"
something like ...[AVG([Memo15],Band8)] but ussing this I get 0!
in other word I need the average sale for a customer.
Sorry if I can not explaing it proprely!
Thank
roberto
what you want is average per invoice.
so you have to count the number of times the innergroupheader appears for each customer.
in opb of first groupheader band4
mycount := 0;
in obp of 2 groupheader
inc(mycount);
in memo in outer footer band7
SUM([Part total], Band6, 1)] / [mycount
this work ok