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

Oracle 6i report with percentage difference.

Status
Not open for further replies.

lgswofford

IS-IT--Management
Sep 16, 2004
5
US
I am using Oracle Reports 6i Report Builder

I am trying to run a report that combines 2 queries.

One query gives me the sum of all entries for the current year. The second query gives me the same information for the previous year.

ie. Parcels Received 2004 = 125
Parcels Sent 2004 = 135
Parcels Held 2004 = 145
Parcels Returned 2004 = 105

Parcels Received 2003 = 110
Parcels Sent 2003 = 150
Parcels Held 2003 = 130
Parcels Returned 2003 = 120

I have 20 different columns of data for each year.

What I need to do is to be able to display the percentage increase or decrease from the previous year on the report. I have the formula as follows.... (CurrentYear-PreviousYear)/100 gives me the percentage that I need.

What I need to know is how to get this information to display on the report. I have tried the summary block and formula block. Can it be done this way or will I have to create another query that gives me the numbers that I need and then incorporate a third query into the report?
 
I would first advise you to look again into the percentage formula. To my mind it should be
(CurrentYear-PreviousYear)/PreviousYear*100
You need to create formula column like this in the Previous Year query, and then make the current year values seen to the previous year query by linking queris by item field using the Link tool in the layour editor. (Item si the field that assumes values "Parcels Received", "Parcels Sent", etc.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top