Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert Columns to Rows

Hi Community,

 

I am trying to convert columns to Rows  and rows to columns from an input excel file to an output table.below is my scenario, 

0683p000009M49P.jpgSource excel

output expected is given below

 

0683p000009M49U.jpgoutput expected

Please help me to design a Talend job to get this output from the given source file

Labels (2)
4 Replies
DataTeam1
Creator
Creator

I used tPivotRow component from Talend Exchange

https://exchange.talend.com/#marketplaceproductoverview:marketplace=marketplace%252F1&p=marketplace%...

 

My example of data

0683p000009M3qK.png

Job

0683p000009M47j.png

Effect

0683p000009M48w.png

 

Don't forget to give kudos when a reply is helpful and when your query is answered, please mark the topic as resolved.

Anonymous
Not applicable
Author


@DataTeam 

Thanks for the quick response. I downloaded the tUnpivotRow component  but unable to find it in talend open studio. i uploaded the downloaded file in Preferences>Talend>component. but it is not showing up in studio palette. 

I am not  using the subscription version. Is that the issue with tUnpivotRow.?

 

 

akumar2301
Specialist II
Specialist II



Hello if you are not willing to use custom component , you can do stuff your own , more dynamically.

step 1 : Get all the ridenames (1st Column)
Step2:Get number of Column in Excel using tJava
Step3 : Loop through each Month Columns and Transpose data. ( 1st and Last Two Rows only)
Step4 : Do cross join(tMap) between result of Step1 and Step3.

Above will work independent of number of columns.
Attaching a Job and sample input I use . Change Global Variable (tSetGlobalVar) accordingly.
 
excelinput_0.1.zip
in.xlsx
DataTeam1
Creator
Creator

@SP_BI you have to unzip the zip file of this component.

I also use open studio so you can use this component in your case too.

My solution does what you need but try to check @uganesh solution because his proposal seems to be much more flexible