Referencing previous rows compued columns

Hi guys,

I'd really like to be able to do this as a calculated computed column
but can't see how...

Given I have 3 DW columns, TOTAL_BALANCE, ADJUSTMENTS & PAYMENTS I want
a computed column COMPUTED_BALANCE which (in English) is 'If it's the
first row show TOTAL_BALANCE otherwise show the previous rows
COMPUTED_BALANCE minus the previous rows ADJUSTMENTS minus the previous
rows PAYMENTS'

I've tried variations using multiple computed columns and can't get
anywhere. It's easy enough to code for in RetrieveEnd...but if there
were a way I'd prefer it to be computed.

Any ideas ?

Regards

Paul Doody
Technical Analyst
Bull Information Systems Ltd
Paul.Doody@Bull.Net
0
Paul
3/24/1998 6:43:17 AM
sybase.powerbuilder.datawindow 28057 articles. 4 followers. Follow

2 Replies
316 Views

Similar Articles

[PageSpeed] 27

Paul,

You should be able to use something like

If ( GetRow ( ) = 1, TOTAL_BALANCE, COMPUTED_BALANCE[-1] - ADJUSTMENTS[-1] -
PAYMENTS[-1] )

HTH

Sanjiv Das [TeamPS]



Paul Doody wrote in message <35175605.7B57@bull.net>...
>Hi guys,
>
>I'd really like to be able to do this as a calculated computed column
>but can't see how...
>
>Given I have 3 DW columns, TOTAL_BALANCE, ADJUSTMENTS & PAYMENTS I want
>a computed column COMPUTED_BALANCE which (in English) is 'If it's the
>first row show TOTAL_BALANCE otherwise show the previous rows
>COMPUTED_BALANCE minus the previous rows ADJUSTMENTS minus the previous
>rows PAYMENTS'
>
>I've tried variations using multiple computed columns and can't get
>anywhere. It's easy enough to code for in RetrieveEnd...but if there
>were a way I'd prefer it to be computed.
>
>Any ideas ?
>
>Regards
>
>Paul Doody
>Technical Analyst
>Bull Information Systems Ltd
>Paul.Doody@Bull.Net


0
Sanjiv
3/24/1998 8:10:46 AM
Sanjiv,
Row referencing only works on actual columns, not on computed fields.
-- 
Terry Dykstra [TeamPS]
Canadian Forest Oil Ltd.

Sanjiv Das [TeamPS] <eMail-SDas@CompuServe.Com> wrote in article
<utTbuNvV9GA.650@forums.powersoft.com>...
> Paul,
> 
> You should be able to use something like
> 
> If ( GetRow ( ) = 1, TOTAL_BALANCE, COMPUTED_BALANCE[-1] -
ADJUSTMENTS[-1] -
> PAYMENTS[-1] )
> 
> HTH
> 
> Sanjiv Das [TeamPS]
> 
> 
> 
> Paul Doody wrote in message <35175605.7B57@bull.net>...
> >Hi guys,
> >
> >I'd really like to be able to do this as a calculated computed column
> >but can't see how...
> >
> >Given I have 3 DW columns, TOTAL_BALANCE, ADJUSTMENTS & PAYMENTS I want
> >a computed column COMPUTED_BALANCE which (in English) is 'If it's the
> >first row show TOTAL_BALANCE otherwise show the previous rows
> >COMPUTED_BALANCE minus the previous rows ADJUSTMENTS minus the previous
> >rows PAYMENTS'
> >
> >I've tried variations using multiple computed columns and can't get
> >anywhere. It's easy enough to code for in RetrieveEnd...but if there
> >were a way I'd prefer it to be computed.
> >
> >Any ideas ?
> >
> >Regards
> >
> >Paul Doody
> >Technical Analyst
> >Bull Information Systems Ltd
> >Paul.Doody@Bull.Net
> 
> 
> 
0
Terry
3/24/1998 6:31:00 PM
Reply: