Page 1 of 1

Datastage PX --

Posted: Fri Mar 06, 2009 4:34 am
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

Posted: Fri Mar 06, 2009 5:33 am
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

Posted: Fri Mar 06, 2009 5:59 am
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

Posted: Fri Mar 06, 2009 6:30 am
by mahadev.v
Search on "Vertical Pivot". It had returned me 160 results.

Re: Datastage PX --

Posted: Wed Mar 18, 2009 6:05 am
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.