<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Converting Columns to Rows in Excel in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305089#M76791</link>
    <description>Thank You. I could clear stage - 1 with your help. Thanks a lot pedro</description>
    <pubDate>Thu, 02 Feb 2012 06:40:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-02-02T06:40:38Z</dc:date>
    <item>
      <title>Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305085#M76787</link>
      <description>I have an excel file with data in following format
&lt;BR /&gt; 
&lt;BR /&gt;Region Name Region Type Data Type Oct 2008 Nov 2008 Dec 2008 
&lt;BR /&gt;Abbeville Metro metro All Homes $137,000 $129,500 $149,500
&lt;BR /&gt;Abbeville city All Homes $145,000 $125,000 $149,000 
&lt;BR /&gt;Erath city All Homes $124,500 
&lt;BR /&gt;Kaplan city All Homes 
&lt;BR /&gt;Maurice city All Homes $224,000 $224,000 $224,000 
&lt;BR /&gt;I am trying to produce an output file which would the data in the following format
&lt;BR /&gt;
&lt;BR /&gt;Region Name Region Type Data Type MonthYear Price
&lt;BR /&gt;Abbeville Metro metro All Homes Oct 2008 $137,000
&lt;BR /&gt;Abbeville Metro metro All Homes Nov 2008 $129,500
&lt;BR /&gt;Abbeville Metro metro All Homes Dec 2008 $149,500
&lt;BR /&gt;Abbeville city All Homes Oct 2008 $145,000
&lt;BR /&gt;Abbeville city All Homes Nov 2008 $125,000
&lt;BR /&gt;Abbeville city All Homes Dec 2008 $149,000
&lt;BR /&gt;Erath city All Homes Oct 2008 $124,000
&lt;BR /&gt;Erath city All Homes Nov 2008 
&lt;BR /&gt;Erath city All Homes Dec 2008 
&lt;BR /&gt;Kaplan city All Homes Oct 2008
&lt;BR /&gt;Kaplan city All Homes Nov 2008
&lt;BR /&gt;Kaplan city All Homes Dec 2008
&lt;BR /&gt;Maurice city All Homes Oct 2008 $224,000
&lt;BR /&gt;Maurice city All Homes Nov 2008 $224,000
&lt;BR /&gt;Maurice city All Homes Dec 2008 $224,000
&lt;BR /&gt;I tried using tMap but just couldnt get it done. What is the best approach to get this done?</description>
      <pubDate>Sat, 16 Nov 2024 12:24:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305085#M76787</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T12:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305086#M76788</link>
      <description>Hi&lt;BR /&gt;Try to download &lt;A href="http://www.talendforge.org/exchange/index.php?eid=148&amp;amp;product=tos&amp;amp;action=view&amp;amp;nav=1,1,1" target="_blank" rel="nofollow noopener noreferrer"&gt;tUnPivotRow&lt;/A&gt; at &lt;A href="http://www.talendforge.org/exchange/index.php" target="_blank" rel="nofollow noopener noreferrer"&gt;Exchange&lt;/A&gt;.&lt;BR /&gt;tUnPivot will change columns into rows.&lt;BR /&gt;Deploy a new component&lt;BR /&gt;Specify a ?User components folder? in TOS preferences (preferences/Talend/Components)&lt;BR /&gt;Copy your newly downloaded component folder in the user components folder&lt;BR /&gt;After launch, you should see your component in folder ?components/user? in org.talend.designer.components.localprovider plugin&lt;BR /&gt;your component should also appear in the Palette in the job designer (in a family folder if relevant)&lt;BR /&gt;Regards,&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 02 Feb 2012 02:47:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305086#M76788</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-02T02:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305087#M76789</link>
      <description>Looks like this would work. I downloaded the component and did as per suggestion.&lt;BR /&gt;Per one of the reference images on talend forge site, could you please tell me how i can add the input rows in Basic Settings of the tUnpivotRow component. &lt;BR /&gt;Thanks a lot for all your help.</description>
      <pubDate>Thu, 02 Feb 2012 03:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305087#M76789</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-02T03:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305088#M76790</link>
      <description>Hi 
&lt;BR /&gt;It is related to this topic 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCqhFCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/How-to-create-two-or-more-sequences-from-a-row-in-Excel-file/td-p/110604&lt;/A&gt;. 
&lt;BR /&gt;Because tUnPivotRow is a custom component, it may encounter code generation error in WIN7. 
&lt;BR /&gt;I have tried to update it with specified TOS version, which is still not compatible for all versions. 
&lt;BR /&gt;Regards, 
&lt;BR /&gt;Pedro</description>
      <pubDate>Thu, 02 Feb 2012 03:37:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305088#M76790</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-02T03:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305089#M76791</link>
      <description>Thank You. I could clear stage - 1 with your help. Thanks a lot pedro</description>
      <pubDate>Thu, 02 Feb 2012 06:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305089#M76791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-02T06:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305090#M76792</link>
      <description>Hi Pedro/Talend Team,
&lt;BR /&gt;You helped me a great deal last time around with this query. However i have run into a strange problem this time around and i hope you can bail me out of this problem.
&lt;BR /&gt;1. I have attached one excel and one csv file. Excel is the input file that is used in the talend job. I have attached it so that you can take a look at the data that needs to be pivoted.
&lt;BR /&gt;2. The output.csv file is the what i need to produce from the talend job.
&lt;BR /&gt;As you can see the source excel file has columns with month and year as headers. The main problem here is i have a folder full of thousands of such files and all the files do not have the same starting point or in other words
&lt;BR /&gt;not all the excel files have data starting from October 2008. Some might start from feb 2010 or some might start from any month and year. But i need to produce an output which looks like this
&lt;BR /&gt;Region Name Region Type Data Type Pivot Key Pivot Value
&lt;BR /&gt;Algonac City All Homes Oct 2008 $139,900
&lt;BR /&gt;Algonac City All Homes Nov 2008 $139,900
&lt;BR /&gt;Algonac City All Homes Dec 2008 $139,900
&lt;BR /&gt;Algonac City All Homes Jan 2009 $125,900
&lt;BR /&gt;Algonac City All Homes Feb 2009 $115,000
&lt;BR /&gt;'
&lt;BR /&gt;'
&lt;BR /&gt;'
&lt;BR /&gt;'
&lt;BR /&gt;'
&lt;BR /&gt;Algonac City Single Fam Oct 2008 $115,000
&lt;BR /&gt;and so on. Basically it should unpivot the headers as well so that i dont have to hard code the month and year value in excel input schema.
&lt;BR /&gt;I have attached screenshots of my talend job and their respective schemas. I am trying hard to find another post or any reference material to do this but i havent had any success yet.
&lt;BR /&gt;Please help me on this as this is the most critical part of the overall business process of my company. I would really appreciate it.
&lt;BR /&gt;Thanks
&lt;BR /&gt;Devesh</description>
      <pubDate>Fri, 05 Oct 2012 17:09:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305090#M76792</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-05T17:09:35Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305091#M76793</link>
      <description>Seems like this wont allow me to attach an excel file.</description>
      <pubDate>Fri, 05 Oct 2012 17:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305091#M76793</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-05T17:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Converting Columns to Rows in Excel</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305092#M76794</link>
      <description>I think you would have to do this yourself using reflection to concatenate the pivot key with the pivot value i.e.:
&lt;BR /&gt;tFileList -iterate-&amp;gt; tFileInputExcel_1 (no header) --&amp;gt; tJavaFlex --&amp;gt; tFilterRow --&amp;gt; tNormalize Data on "~" --&amp;gt; tExtractDelimitedFields Data on "#" --&amp;gt; tFileOutputDelimited.
&lt;BR /&gt;tFileInputExcel would have to have enough columns to cover as many months as there could possibly be in one file. tFilterRow just removes the header row (tos_count_tFileInputExcel_1!=1). In tJavaFlex with schema RegionName|RegionType|DataType|Data, your code would be like:
&lt;BR /&gt;
&lt;PRE&gt;============= Start code =============&lt;BR /&gt;java.lang.reflect.Field[] input_fields = row1.getClass().getDeclaredFields();&lt;BR /&gt;Object[] months = new Object;&lt;BR /&gt;============= Main code =============&lt;BR /&gt;int position = -1;&lt;BR /&gt;row2.Data = "";&lt;BR /&gt;for( java.lang.reflect.Field field : input_fields ) {&lt;BR /&gt;	if (++position&amp;lt;5) {&lt;BR /&gt;		continue;&lt;BR /&gt;	}&lt;BR /&gt;	field.setAccessible(true);&lt;BR /&gt;	Object fieldvalue = field.get(row1);&lt;BR /&gt;	if (tos_count_tFileInputExcel_1==1) {&lt;BR /&gt;		months = fieldvalue;&lt;BR /&gt;	} else if (months!=null) {&lt;BR /&gt;		row2.Data += (position==5?"":"~") + months + "#" + (fieldvalue==null?"":fieldvalue);&lt;BR /&gt;	}&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 Oct 2012 09:24:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Converting-Columns-to-Rows-in-Excel/m-p/2305092#M76794</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2012-10-06T09:24:03Z</dc:date>
    </item>
  </channel>
</rss>

