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!

% change between summaries

Status
Not open for further replies.

rrmcguire

Programmer
Oct 13, 2010
304
0
0
US
Is it possible to calculated a percent change between two summaries?

i.e. For current year I have 'summary A total' and for previous year I have 'summary B total'

I want to find the percent change (up or down) from Summary B to Summary A


thanks for any help provided
 
Please explain how you created the two totals and in what sections they are located. Also identify the group structure of the report. At what level are you looking for the percent change? At the grand total level?

-LB

 
The current year total is from the below:

if {SHIPMENTS_TTX.PICKUPDATE} >= {@Current Min} and
{SHIPMENTS_TTX.PICKUPDATE} <= {@Current Max} then {SHIPMENTS_TTX.TOTALCHARGES}
else 0

Where Current Min = Minimum(parameter field Date range Current Year), Current Max = Maximum(parameter field Date range Current Year)

if the pickupdate is within that date range for a certain record then show the total charges for that record.


The same thing is done for the previous year as:

if {SHIPMENTS_TTX.PICKUPDATE} >= {@Previous Min} and
{SHIPMENTS_TTX.PICKUPDATE} <= {@Previous Max} then {SHIPMENTS_TTX.TOTALCHARGES}
else 0


The records are then grouped by the 'CARRIER ID' which is diplayed on each record, the % change will be for each carrier where Im doing a 'Top N' either 50, 100, or 200

thanks
 
So you inserted sums on these formulas at the carrierID group level? Percent change formula would then be:

if sum({@prevyrtotal},{table.chargeID}) <> 0 then
(sum({@curryrtotal},{table.chargeID})-sum({@prevyrtotal},{table.chargeID}))% sum({@prevyrtotal},{table.chargeID})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top