thread767-1635183
My goal is to create a report showing the number of AR Days per month per hospital as indicated by the following array:
Hosp1 Hosp2 Hosp3 Total
Month1 x x x x
Month2 x x x x
. x x x x
. x x x x
. x x x x
Month12 x x x x
My AR Days formula is as follows:
if ({PatientSummaryTBMonthly.FYear}="2007" and {PatientSummaryTBMonthly.Period}<12) then 0
else
(evaluateafter ({@3MRAvgCharges});
whileprintingrecords;
numbervar x;
{@UpdatedEndBal}/(x/{@3MRAvgDays}))
{@3MRAvgCharges}, from the previous thread, which indicates the average charges for the current month together with the prior two, is as follows:
whileprintingrecords;
numbervar array rev;
numbervar i;
numbervar j;
numbervar x := 0;
if onfirstrecord then (
redim rev[1];
) else
(
redim preserve rev [ubound(rev)+1];
);
j := ubound(rev);
rev[j] := tonumber(sum({PatientSummaryTBMonthly.TB Period Charges},{@ToDate}));
if j < 4 then (
x := sum(rev);
) Else
(
for i := j-2 to j do (
x := x + rev;
);
x;
);
x
{@3MRAvgDays} indicates the average number of days in the current month together with the prior two, is as follows:
day(dateserial(year({@ToDate}),month({@ToDate})+1,0))+
(day(dateserial(year({@ToDate}),month({@ToDate}),0)))+
(day(dateserial(year({@ToDate}),month({@ToDate})-1,0)))
When I put the AR Days formula in my design view GF1, group being @todate, I do get the proper result for the "total" column (the total amount of AR Days across all hospitals combined). However, the problem lies with the individual hospitals.
I have a hospital field which I have tried adding to the criteria in the AR Days formula, however, that is not giving me the correct results.
I have tried changing the groupers to make hospital the primary, @todate the secondary, and period the tertiary which did give the proper results by hospital, however, each set of 12 months was repeated as many times as there are facilities and, in the process, the total column then was not accurate.
How, then, do I simply get the hospital numbers and the total numbers to be accurate and in one clean array?
My goal is to create a report showing the number of AR Days per month per hospital as indicated by the following array:
Hosp1 Hosp2 Hosp3 Total
Month1 x x x x
Month2 x x x x
. x x x x
. x x x x
. x x x x
Month12 x x x x
My AR Days formula is as follows:
if ({PatientSummaryTBMonthly.FYear}="2007" and {PatientSummaryTBMonthly.Period}<12) then 0
else
(evaluateafter ({@3MRAvgCharges});
whileprintingrecords;
numbervar x;
{@UpdatedEndBal}/(x/{@3MRAvgDays}))
{@3MRAvgCharges}, from the previous thread, which indicates the average charges for the current month together with the prior two, is as follows:
whileprintingrecords;
numbervar array rev;
numbervar i;
numbervar j;
numbervar x := 0;
if onfirstrecord then (
redim rev[1];
) else
(
redim preserve rev [ubound(rev)+1];
);
j := ubound(rev);
rev[j] := tonumber(sum({PatientSummaryTBMonthly.TB Period Charges},{@ToDate}));
if j < 4 then (
x := sum(rev);
) Else
(
for i := j-2 to j do (
x := x + rev;
);
x;
);
x
{@3MRAvgDays} indicates the average number of days in the current month together with the prior two, is as follows:
day(dateserial(year({@ToDate}),month({@ToDate})+1,0))+
(day(dateserial(year({@ToDate}),month({@ToDate}),0)))+
(day(dateserial(year({@ToDate}),month({@ToDate})-1,0)))
When I put the AR Days formula in my design view GF1, group being @todate, I do get the proper result for the "total" column (the total amount of AR Days across all hospitals combined). However, the problem lies with the individual hospitals.
I have a hospital field which I have tried adding to the criteria in the AR Days formula, however, that is not giving me the correct results.
I have tried changing the groupers to make hospital the primary, @todate the secondary, and period the tertiary which did give the proper results by hospital, however, each set of 12 months was repeated as many times as there are facilities and, in the process, the total column then was not accurate.
How, then, do I simply get the hospital numbers and the total numbers to be accurate and in one clean array?