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

Group Total Help Take 2

Status
Not open for further replies.

Garyjr123

MIS
Sep 14, 2010
139
US
I'm having trouble getting a report to show totals for group. Below is how the report is structured. I used running totals.

GH1 SF.SRCFAC
GH2 TEST.TESTCODE [suppressed]
D [suppressed]
GF2a [TEST.NAME] [TEST.TESTCODE] Total Resulted: @Total Code

@Total Code: {#Other Code Total} + {#Stat Code Total} + {#Routine Code Total}

GF2b @Routine Code #Routine Total Code
GF2c '{TEST.TESTCODE}TIMED' #Other Code Total
GF2d @Stat Code #Stat Code Total
GF1 @Source Facility Total

@Source Facility Total: {#Other Code Total} + {#Stat Code Total} + {#Routine Code Total} (I know this is no where correct)

I want GF1 to have a grand total of [Total Resulted: @Total Code] from GF2a

GF2b #Routine Code Total:
Summary
Field to summarize: PATIENT.PID
Type of summary: distinct count
Evaluate
Use a formula: {TESTREQ.PLKEY} = '151'
Reset
On change of group: Group #2 TEST.TESTCODE -A

GF2c #Other Code Total:
Summary
Field to Summarize: PATIENT.PID
Type of summary: distinct count
Evaluate
Use a formula: {TESTREQ.PLKEY} = '164'
Reset
On change of group: Group #2 TEST>TESTCODE -A

GF2d #Stat Code Total:
Summary
Field to summarize: PATIENT.PID
Type of summary: distinct count
Evaluate
Use a formula: {TESTREQ.PLKEY} = '163'
Reset
On change of group: Group #2 TEST.TESTCODE -A

Example of how results should show:

GH1 ED SOURCE FACILITY TOTAL: 14
GH2 TEST.TESTCODE [suppressed]
D [suppressed]
GF2a COMPLETE BLOOD COUNT CBC TOTAL RESULTED: 4
GF2b CBC ROUTINE: 1
GF2c CBC STAT: 3
GF2d CBC TIMED: 0
GF2a ALBUMIN ALB TOTAL RESULTED: 10
GF2b ALB ROUTINE: 5
GF2c ALB STAT: 4
GF2d ALB TIMED: 1

So five calculations for totals in this report. 3 for routine, stat, timed; 1 total for the test (routine + stat + timed/other = total tests resulted); and grand total for the source facility (test + test + test... = grand total for sourc facility).

I'm positive that his is confusing so please let me know if I need to clarify anything.

Thanks,

Gary
 
Place a formula like this in GF2a:

//{@accum} - to be suppressed:
whileprintingrecords;
numbervar tot := tot + {@TotalCode};

Then in GF1, use this formula:

//{@display}:
whileprintingrecords;
numbervar tot;

You must add a reset to GH1 (and suppress it):
whileprintingrecords;
numbervar tot;
if not inrepeatedgroupheader then
tot := 0;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top