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

running totals/differences

Status
Not open for further replies.

Honestmath

Technical User
Jan 8, 2003
25
US
hey there,

can anyone tell me if there is a way to create not just a running total (which i saw on MSKB), but also a running difference... e.g. my data looks like this

Bdate Prc1 HoldChg

1-Jan-90 33 100
3-Jan-90 40 -50
5-Jan-90 38 -25
7-Jan-90 34 80
8-Jan-90 33 -105


and i need to calculate a couple fields based on the (ordered) difference between the current and previous value.

RT1 RD1 RT2
RunTot Rundiff runtot
Bdate Prc1 HoldChg of Holdchg prc1* <----that col
holdchg(-1)
1-Jan-90 33 100 100 0 0
3-Jan-90 40 -50 50 700 700
5-Jan-90 38 -25 25 -100 600
7-Jan-90 34 80 105 -100 500
8-Jan-90 33 -105 0 -105 395


to clarify, RD1 = (prc1(i)-prc1(i-1))*holdchg(i-1)

is this possible??

thanx so much for the help

math
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top