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!

Formula to calculate difference between records

Status
Not open for further replies.

up4a

Technical User
Apr 27, 2010
19
US
Using crystal XI linking to a single SQL table

I have a small sub-report that is selecting records based on
{@CustomerNo} = {?Pm-?Customer} and
{@Date} in [{?Pm-?EndDate}, {?Pm-?StartDate}]

It returns AR balances for the start and end date for the selected customer.

Date OpenBal Current Over30 Over60 Over90 Over120
5/15/2014 160,852 129,102 26,468 1,857 638 2,788
7/2/2014 149,180 112,914 29,563 1,775 1,177 3,749

I just want to add a field for each column showing the % change from start date to end date. So for Open balance (149,180-160,852)/160,852 for some reason I can't seem to figure out the bast way to do this. Any ideas?

As always thanks so much for the help!
 
(({end_balance}/{start_balance})-1)*100

You need to subtract the 1 or you'll see 110% when the actual increase is 10%
 
Thanks Charliy,

end_balance and start_balance are not fields or formulas,

I figured it out, I am using a formula to pull each start and end balance.

If {date} = {?StartDate} then {OpenBal} etc.. then a formula to calculate the % change.. a total of 18 separate formula's [glasses]
 
Shoot.. I spoke too soon.

Using the above formulas it is returning values in the detail section and the start value int he header and the end in the footer but I need something that will select the start and end balance in the header or the footer. Back to the drawing board.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top