Error using RowProcCompareWithPreviousValue

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Axa
Participant
Posts: 2
Joined: Wed Nov 08, 2006 12:55 am

Error using RowProcCompareWithPreviousValue

Post by Axa »

Hi,

I am trying to use the following expression:

If RowProcCompareWithPreviousValue(Order_Details_in.OrderID) Then RowProcGetPreviousValue((Order_Details_in.UnitPrice- Order_Details_in.Discount)* Order_Details_in.Quantity) Else 0.

I want to create a total per Order ID in the target file - the stage Aggregator is not available - this is not a Parallel job.

My idea was to get the 'Result expected' but I am getting the OrderID numbers of the current rows - I don't know why.

OrderID | Unit | Discount | Quantity | Result expected | Result Returned
10 | 10 | 1 | 33 | NULL | 10
10 | 05 | 2 | 12 | 297 | 10
20 | 03 | 0 | 34 | 000 | 20
20 | 16 | 2 | 66 | 102 | 20
20 | 18 | 2 | 38 | 924 | 20

Thanks in advance,
regards,
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why do you claim that the Aggregator stage is not available?

With sorted input, an approach using stage variables in a Transformer stage is definitely viable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply