Hi all,
I want to get the following as output from the input provided.
input:-
a
a
a
b
b
c
d
d
d
output :-
a 1 1
a 1 2
a 1 3
b 2 1
b 2 2
c 3 1
d 4 1
d 4 2
d 4 3
Kindly suggest
To get the output for counting the occurence of the rows
Moderators: chulett, rschirm, roy
Suggest you do more than simply post input and output samples. How about spelling out your requirement in words? Telling us what you've tried and what issues you faced?
I see a simple dual count exercise that stage variables can solve.
I see a simple dual count exercise that stage variables can solve.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 536
- Joined: Thu Oct 11, 2007 1:48 am
- Location: Bangalore
Hi,
Create stage variables in transformer in below order:-
Initialze SEQUENCE to 1.
Map it to output derivation.It should be your result that you are looking for.
Create stage variables in transformer in below order:-
Code: Select all
CURR=Input.Col
COUNTER=if CURR=PREV THEN COUNTER+1 ELSE 1
SEQUENCE=if CURR=PREV THEN SEQUENCE+1 ELSE SEQUENCE
PREV=CURR
Map it to output derivation.It should be your result that you are looking for.
Thanks
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/
Prasoon
ETL Consultant
LinkedIn :- http://www.linkedin.com/profile/view?id ... ab_pro_top
Blog:- http://dsshar.blogspot.com/