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!

Get difference between 2 groupings

Status
Not open for further replies.

richl13

Programmer
May 1, 2007
16
0
0
US
I have a report with 2 groupings. Each group has 7 rows and totals.

For example I have 1 group with:
A, 1000, 1000
B, 2000, 1000
C, 1000, 1000
D, 2000, 2000
Totals, 6000, 5000

Another group with:
A, 2000, 3000
B, 3000, 3000
C, 2000, 2000
D, 1000, 2000
Totals, 8000, 10000

What I would then like to see is:
A, -1000, -2000
B, -1000, -2000
C, -1000, -1000
D, 1000, 0
Totals, -2000, -5000

Is there any way to find the differences (3rd section above) for the 2 groups rows and totals?
 
Please identify the field(s) you are grouping on and the names of the fields shown, and also clarify whether the rows you are showing are details or whether they are another group. If they are nested groups, identify the type of summary used for each value field you are showing.

-LB
 
Thanks for the reply.

This report is a grand total report for hospitals forecast by finclass. I am trying to compare the overall totals for all hospitals. Group1 is the current forecast and Group2 is the previous forecast. I need to also display the differences.

The report has a grouping on forecast(date) and finclass. The Fields (A,B,C,D) are the finclasses. The other 2 columns would be the sum of charges and sum of payments. The Totals line is a sum of the finclasses for the forecast.
 
I think you could just insert a crosstab in the report footer that uses {table.finclass} as the row field, and then add two summaries (sums) of the following formulas:

//{@charges}:
if {table.forecastdate} >= <your criterion to distinguish current from previous> then
{table.charges} else
-{table.charges}

//{@payments}:
if {table.forecastdate} >= <your criterion to distinguish current from previous> then
{table.payment} else
-{table.payment}

In the customize style tab, choose summary->horizontal->show labels.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top