Datastage PX --

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
dinesh.ds83
Participant
Posts: 2
Joined: Fri Mar 06, 2009 4:11 am

Datastage PX --

Post by dinesh.ds83 »

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
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

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 Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
dinesh.ds83
Participant
Posts: 2
Joined: Fri Mar 06, 2009 4:11 am

Post by dinesh.ds83 »

Hi

I searched, I didn't got any related one's.
if you have time can you explain me please

It will be helpful to me

Thanks
Dinesh
Dinesh
mahadev.v
Participant
Posts: 111
Joined: Tue May 06, 2008 5:29 am
Location: Bangalore

Post by mahadev.v »

Search on "Vertical Pivot". It had returned me 160 results.
"given enough eyeballs, all bugs are shallow" - Eric S. Raymond
Pagadrai
Participant
Posts: 111
Joined: Fri Dec 31, 2004 1:16 am
Location: Chennai

Re: Datastage PX --

Post by Pagadrai »

dinesh.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
Hi
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.
Post Reply