Page 1 of 1

Row comparison

Posted: Tue Feb 08, 2011 1:29 am
by kalpanam
Hi All,

I have input data as below:

SESSION ID PAGE NUMBER PAGE_NAME
123 1 akajak
123 3 lkuibgt
123 7 opgyt
567 1 hagdljkh
890 1 haklik
890 4 kuioud
890 7 jhkljkl



I need to implement "IF next record is the same Session_ID, then take Page_Number from the next record, subtract 1 from this Page_Number else some other logic.

Could anyone suggest me how can i implement this logic.
Please let me know if need anymore clarification?

Thanks & regards,
Kalpana.

Posted: Tue Feb 08, 2011 2:09 am
by ray.wurlod
Stage variables or upstream Sort stage for detecting key change. Other stage variables for maintaining page number for output. Note that you cannot look ahead, only back. But you could sort your data in reverse order!

Posted: Tue Feb 08, 2011 3:13 am
by kalpanam
ray.wurlod wrote:Stage variables or upstream Sort stage for detecting key change. Other stage variables for maintaining page number for output. Note that you cannot look ahead, only back. But you could sort your da ...
Could you please explain me in detail.that will be more helpfull to me to proceed further.

Thanks & Regards,
Kalpana.

Posted: Tue Feb 08, 2011 12:16 pm
by ray.wurlod
Search DSXchange for examples - it has been well explained in the past.