Compare the current row to previous row

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
KFajardo
Participant
Posts: 17
Joined: Mon May 11, 2015 7:22 pm
Location: Philippines

Compare the current row to previous row

Post by KFajardo »

Hi guys,

is there a way that i can compare the current row to the previous row?

The logic is this:

If CurrentRec = PrevRec
Then
ColumnOut= PrevRec
Else
Current Row

Thanks,
Keith
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Short answer is yes.

This article might help with the whole record approach. You should also become very familiar with stage variables as they can be used to hold previous values (including a complete record string) since they are evaluated in order from top to bottom.
-craig

"You can never have too many knives" -- Logan Nine Fingers
KFajardo
Participant
Posts: 17
Joined: Mon May 11, 2015 7:22 pm
Location: Philippines

Post by KFajardo »

Thank you,chulett for answering my questions with dedication. I really appreciate it.

And, yes. I really have to study more about stage variables. That's reason why I am asking a lot.

Thanks again. I will check the link.

keith
Post Reply