Convert multiple rows into columns in datastage

Hi
i have sourse like
name,city
johny,newyork
johny,mumbai
johny,del
want output like
name,city1,city2,city3
johny,nework,mumbai,delhi
thanks in advance..

Questions by sai3689   answers by sai3689

Showing Answers 1 - 15 of 15 Answers

Ruchir

  • Apr 7th, 2015
 

Use a vertical Pivot option available in Pivot Enterprise stage(Stage tab-->Properties-->Pivot Type=Vertical)

Again in stage-->Pivot properties tab-->group by on Name column and Pivot using City column.

Then select array size=3.

  Was this answer useful?  Yes

Nish

  • May 25th, 2015
 

Pivot Enterprise stage is from 8.5 onwards. the generic solution would be to include a sort stage with key change column and then transformer stage with stage variables and field functions

  Was this answer useful?  Yes

praveen kumar

  • Nov 19th, 2015
 

I have source like this
sno,marks
1,85
1,90
1,95

I want output like below
sno,maths,physics,chemistry
1,85,90,95

Without Using pivot Enterprise stage.

  Was this answer useful?  Yes

Abhinandan

  • Nov 20th, 2015
 

Use 2 stage variable in transformer
Stagevar: if Stagevar1=sno then marks:",":Stagevar Else marks
Stagevar1: sno
map stageVar to marks

  Was this answer useful?  Yes

Sharali Sharna

  • Nov 24th, 2015
 

You can use Pivot Enterprise stage to achive this.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions