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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manual Running Total Help 1

Status
Not open for further replies.

cyreports

Programmer
May 12, 2010
89
US
The issue I am having is I need in my Group 1 footer total. What I need is the count of days for each Assigned unit for each guarantor, for each distinct case type.

In my Group Header # 1 (AssignedUnit), I have the following formula inserted: @RunningSumReset.

In my Group Footer #1 (AssignedUnit), I have the following formula inserted: @Running_Sum

I am not getting the correct values and have tried every combination I can think of. Any assistance is appreciated.

#RTotal0
Code:
Field to summarize: SINGLEDATE
Type of summary: distinct count
Reset - On change of group: GuarantorName

RunningSumReset
Code:
NumberVar Running_Pay;
WhilePrintingRecords;
Running_Pay := 0

Running_Sum:
Code:
NumberVar Running_Pay;
WhilePrintingRecords;
Running_Pay := Running_Pay + {#RTotal0}

 
I assume GuarantorName is group 2, in which case the value of #RTotal0 will only be the total for the last guarantor when you use it in Grp1 footer.

Please show layout of groups and sample data with waht you expect to see and what in fact you are getting.

Ian
 
Ian,

You are correct, GuarantorName is in group 2. I am in fact getting the value for just the last guarantor when this is in the Group 1 footer. Is there anyway to accomplish this? I can supply the groupings and sample data, however it seems you nailed the issue right on the head. If its still needed, I will get it all to you.

 
YOu can change the reset to Group 1, of course if you want to see the RT for each Guarantor, you will need to create another RT, summing the same amount but resetting in Group1.

Ian
 
Ian,

I moved the reset to my Group 1 Header (Assigned Unit) and I still keep getting the last Guarantors total in my Group 1 Footer. Not sure what I missed.
 
I can't tell what you are trying to do here, but I don't think you need a combination of inserted and manual running totals.

1-Please explain where the case type comes into this.

2-Do you need to see a running accumulation or you just trying to get a Group#1 summary?

-LB
 
LBass -

Case Type is one of two values - Medical or BHS. A patient can have one or both of these case types at a given time period. If they have dates that overlap or equal, I am only needing to count that as one day. For example, patient John Smith was out on Medical and BHS reasons for today, I would count this as one day. Most of the time they don't have both case types assigned to them, but it does happen.

What I need is the count of days by Assigned Unit (Group 1), by Guarantor (Group 2) by Case Type (Group 3). I need the sum I did with the Running total #RTotal0 that gave me the sum of the Guarantor days in my Group 1 footer. For some reason, all I keep getting is my last Guarantor balance in this field. I hope this makes sense.
 
So you are using a distinct date at the guarantor level in order to ensure that case types on the same date are only counted once? If that works, then all you have to do is use these three formulas:

//{@reset} to be placed in the GH#1:
whileprintingrecords;
numbervar running_pay;
if not inrepeatedgroupheader then
running_pay := 0;

//{@accum} to be placed in the GH#2:
whileprintingrecords;
numbervar running_pay := running_pay + distinctcount({table.singledate},{table.guarantorname});

//{@display} to be placed in GF#1:
whileprintingrecords;
numbervar running_pay;

-LB
 
lbass -

If you could see the smile on my face it would speak a million words! THANK YOU, THANK YOU, THANK YOU! This is exactly what I wanted!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top