I/P
EMPLY_ID, EMPLY_NAME,TRNVR_CDE,Count
"4346586 ","CRUZ M","CLS ","3 "
"4346586 ","CRUZ M","NEW ","9 "
"4346586 ","CRUZ M","TRN ","2 "
"4346586 ","CRUZ M","UPS ","2 "
O/P
EMPLY_ID, EMPLY_NAME CLS_Count,NEW_count,TRN_count,UPS_count
"4346586 ","CRUZ M",3,9,2,2
Is it possible ?
Any reply it will be greatful to me
Datastage PX --
Moderators: chulett, rschirm, roy
Take a look around.....this topic has been covered many times...there are many ways to do it....one might call this a "reverse pivot," where you are collapsing "n" rows back into 1. There are techniques that use Stage variables and aggregators, and others that use counters and constraints. Whether "n" is fixed or not is also an issue.
Ernie
Ernie
Ernie Ostic
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
-
- Participant
- Posts: 2
- Joined: Fri Mar 06, 2009 4:11 am
Re: Datastage PX --
Hidinesh.ds83 wrote:I/P
EMPLY_ID, EMPLY_NAME,TRNVR_CDE,Count
"4346586 ","CRUZ M","CLS ","3 "
"4346586 ","CRUZ M","NEW ","9 "
"4346586 ","CRUZ M","TRN ","2 "
"4346586 ","CRUZ M","UPS ","2 "
O/P
EMPLY_ID, EMPLY_NAME CLS_Count,NEW_count,TRN_count,UPS_count
"4346586 ","CRUZ M",3,9,2,2
I have an idea to accomplish this.
But am not sure if ur source is file or DB. anyway,
1) Your new source will have all distinct EMP_ID and EMP_NAME
2) You split the source file into 4 lookup fileset - for each count.
4) With the new source file, and all the 4 lookup filesets as lookups you can get obtain all the counts.
As mentioned in above posts, there are lot of ways to do this using Stage variables and all. I just mentioned one of the approach.
Let us know once you try it.