Page 1 of 1

Assigning Column value from previous row column value

Posted: Fri Sep 22, 2006 7:46 am
by Lotus26
Hi All,


I struck up doing a job here. I have a data file in the following format.

LOC DEPT STOCK
10, 1, 10
, 2, 20
, 3, 15
, 4, 15
20, 5, 10
, 8, 15
, 12, 12
30, 25, 15
, 30, 15



I have to assign the LOC '10' to the 2nd,3rd,4th records and LOC '20' to the next two records and 30 to the next record. Can any one help me in doing this job.

The ouput of the job should be

LOC DEPT STOCK
10, 1, 10
10, 2, 20
10, 3, 15
10, 4, 15
20, 5, 10
20, 8, 15
20, 12, 12
30, 25, 15
30, 30, 15



I appreciate your time and help in advance

Thanks
Lotus

Posted: Fri Sep 22, 2006 8:26 am
by keshav0307
Use transformer stage:
define a stage varialbles

Sprev=(If LOC='' Then LOC Else Sprev)

and map this variable to the LOC Column

Posted: Fri Sep 22, 2006 8:50 am
by keshav0307
sorry the varibale value shoukd be

Sprev=(If LOC<>'' Then LOC Else Sprev)

Posted: Fri Sep 22, 2006 10:05 am
by Lotus26
I figured it out. Thanks for your time
keshav0307 wrote:sorry the varibale value shoukd be

Sprev=(If LOC<>'' Then LOC Else Sprev)

try this ,this may be helpful

Posted: Mon Sep 25, 2006 12:20 am
by boppanakrishna
Lotus26 wrote:I figured it out. Thanks for your time
keshav0307 wrote:sorry the varibale value shoukd be

Sprev=(If LOC<>'' Then LOC Else Sprev)

Hi all,
For this example take "lpre" and for the "lpre" variable assign the logic as " If Inputlink.Loc = " " Then lpre Else DSLink3.Loc "
In the out put derivation,assign "lpre" variable to the "LOC" column