Stage to Use

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
Rajav123
Participant
Posts: 5
Joined: Wed Oct 05, 2011 9:47 am

Stage to Use

Post by Rajav123 »

Data is in source as below and needed to be loaded into target as specified.
I thought of pivot stage. Couldyou asuugest any ideas?

Source:
=======
ORDER ID GROUND AIR EXPRESS PRIORTY
1 None No No Yes
2 Yes None No Yes

Target:
======
ORDER ID Ship Desc
1 GROUND None
1 AIR No
1 EXPRESS No
1 PRIORTY Yes
2 GROUND Yes
2 AIR None
2 EXPRESS No
2 PRIORTY Yes

Thank you
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Transformer stage with four outputs brought together in a downstream Funnel stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Rajav123
Participant
Posts: 5
Joined: Wed Oct 05, 2011 9:47 am

Post by Rajav123 »

Thank you Ray.
ORDER_ID GROUND AIR EXPRESS PRIORTY
1 None No No Yes
2 Yes None No Yes

When I run the job, data displays as

ORDER ID GROUND AIR EXPRESS PRIORTY
1 None No No Yes
1 None No No Yes
1 None No No Yes
1 None No No Yes
2 Yes None No Yes
2 Yes None No Yes
2 Yes None No Yes
2 Yes None No Yes

It should be
ORDER ID
1 Ground NONE
1 Air No
1 Express No
1 Priority Yes
Transformet has 4 outputs fed to Funnel. I used 'Continuous Funnel',.

-Thank you
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Each output link from the Transformer has three columns. The first is mapped directly from the ORDER_ID column. The second is derived - differently on each link - as a constant, one of the four remaining column headings, perhaps with case adjusted (GROUND --> "Ground"). The third is mapped directly from the appropriate non-key input column.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Post by fmou »

double post deleted.
Last edited by fmou on Thu Oct 20, 2011 12:54 pm, edited 1 time in total.
fmou
Participant
Posts: 124
Joined: Sat May 28, 2011 9:48 pm

Post by fmou »

take a look at this, which answers your question well.

Pivoting with an description
viewtopic.php?t=142442
Post Reply