Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Previous month record on group footer 1

Status
Not open for further replies.

visit2me

MIS
May 21, 2010
17
0
0
US
Hi all,
I need help understanding how can I accompolish my goal here to display previous month total on group footer.
EG. I have 2 groups Month and Date by weeks
Gp1: Month, Gp2: Date by week.

GH1: June Count of BOOk count of emp
Gf2 06/01/11 50 100
Gf2 06/07/11 50 100
Gf2 06/14/11 50 100

GF1a total June 150 300
GF1b Avg total: 500 400

Note: Avg total count of BOOk and emp for the month of June is 500 and 400 and both these total are from previous month May total.

GH1: July Count of BOOk count of emp
GF2 07/01/11 30 200

..............................................
...................................
...............
GF1 total July 420 600
GF1b Avg total: 150 300

Note: Avg total count of BOOk and emp for the month of July is 150 and 300 are both previous month June total.

And July total count 420 and 600 will be Avg total for month of August and so on.

Thanks in advance



 
This can be done, but I don't follow the logic of presenting a previous month's count as an average, when it is not.

-LB
 
Ibass, thanks for quick reply. I guess, i meant to say Total only instead of Avg. total. Do you follow my question now?
How would you tackle this problem?

Thanks.
 
Well, it's not a total either--it's the previous months total only.

Create formulas like this following and place them in GF1b:

//{@previousbook}:
whileprintingrecords;
numbervar currbk;
numbervar prevbk := currbk;
currbk := count({table.book},{table.date},"monthly");
prevbk

//{@previousemp}:
whileprintingrecords;
numbervar curremp;
numbervar prevemp := curremp;
curremp := count({table.emp},{table.date},"monthly");
prevemp

These formulas will be 0 for the first group, since there won't be any previous values.

-LB
 
Thanks for solution. I works great except for one which i failed to mention in my previous note that the count of book and emp are my running total instead and now I get "This field can't be summarized" error message. I have to have running total on my GF2 and only way out for me to correct counting of Book and emp. Do you know a way around in your formula?
 
Nevermind Ibass, I got it right.
I modified your formula on with currbk := sum({table.emp},GF1a);
and it worked great.

Thank you so much,


whileprintingrecords;
numbervar
currbk;numbervar prevbk := currbk;
currbk := sum(GF1a,{table.emp});
prevbk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top