Transformation Logic
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Transformation Logic
Hi All,
i have a source dataset in which columns are two like this
Col1,Col2
1,A
1,B
1,C
and i want to develop some logic in transformer,so that my target data will be like this:-
Col1,Col2
2,A
3,B
4,C
Can anyone help me to do this using stage veriable..???or is there any other way out to do this..??
i have a source dataset in which columns are two like this
Col1,Col2
1,A
1,B
1,C
and i want to develop some logic in transformer,so that my target data will be like this:-
Col1,Col2
2,A
3,B
4,C
Can anyone help me to do this using stage veriable..???or is there any other way out to do this..??
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
have you tried searching the forum?
stage variables is not a good option unless you have to reset the counter depending on keys on key partitioned data.
If you just want to generate a sequence number use surrogate key generator stage or surrogate key functionality of transformer.
stage variables is not a good option unless you have to reset the counter depending on keys on key partitioned data.
If you just want to generate a sequence number use surrogate key generator stage or surrogate key functionality of transformer.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Yes i want counter that should be incremented by 1 for every new records and starting value will be COL1 value +1priyadarshikunal wrote:have you tried searching the forum?
stage variables is not a good option unless you have to reset the counter depending on keys on key partitioned data.
If you just want to generate a sequence number use surrogate key generator stage or surrogate key functionality of transformer.
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Create a stage variable say svCount intialize it to 0.
in derivation put
reiterating words from my previous post also what sainath told that if you want to increment that value for each record them its best to use surrogate key.
in derivation put
Code: Select all
if svCount=0 then col1+1 else svCount+1
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Thanks a lot........it resolved my requirment...priyadarshikunal wrote:Create a stage variable say svCount intialize it to 0.
in derivation putreiterating words from my previous post also what sainath told that if you want to increment that value for each record them its best to use surrogate key.Code: Select all
if svCount=0 then col1+1 else svCount+1
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Thanks for reminding me.
I just wanted to give a straight answer as the topic's question is quite broad/generic and there can be a lot of concequences based of data and nature of requirement. No one can give a perfect answer unless requirements are crystal clear else have to guess.
Hope the poster knows exactly what he/she wants.![Wink :wink:](./images/smilies/icon_wink.gif)
![Wink :wink:](./images/smilies/icon_wink.gif)
I just wanted to give a straight answer as the topic's question is quite broad/generic and there can be a lot of concequences based of data and nature of requirement. No one can give a perfect answer unless requirements are crystal clear else have to guess.
Hope the poster knows exactly what he/she wants.
![Wink :wink:](./images/smilies/icon_wink.gif)
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.![Wink :wink:](./images/smilies/icon_wink.gif)
Genius may have its limitations, but stupidity is not thus handicapped.
![Wink :wink:](./images/smilies/icon_wink.gif)