Four Stars

Question on Excel import and unpivot

I'm trying out talend and made a basic excel to import and then spit out in excel unpivoted.  I downloaded and installed tUnpivot, but that's not what's failing me, I think.

I edited the Excel schema and made this:

image.png

But then when I clicked the output tab, this happened.

 

image.png

Which is unfortunate because my tUnpivotRow complains

image.png

 

Because it has no columns to pivot.  So I look at the available columns by clicking the row1 connector, and it's only pivot key

image.png

 

And I really want it to be the Source, Segment and Company from above.  So do I just force the issue in the connector and hand insert the columns.  I just started Talend, so haven't really delved into the generated code, nor read up on the objects it makes available.  I think it would probably take a week to figure it out, and I really don't have a week to mess around.  I did take a peek at the code, and noticed the code itself is throwing up an error, probably because row2.pivot_key doesn't exist if the row 2 connector doesn't really carry a state and just reflects the data going between the components.  It seems that is the case based on how the code is generated.  There is no connector code.  It's just component to component.  So I could monkey around with the code, but is that the real solution?  I'm probably going to have to monkey with the code anyway because the excel thingy steps on my headers by adding a "_" in place of the first character of my header instead of appending it to the beginning.  Had it done the latter, I could just manipulate the value in the columns easier after I unpivot, because I'd know just to break off the "_" and parse the number.

 

image.png

1 REPLY
Community Manager

Re: Question on Excel import and unpivot

Hi
I am not sure if you use the right component for your need, can you please give an example data to explain your requirement, what are your source data and what are your expected result? It will be helpful for us to understand the problem and suggest the solution.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business