<?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: Transpose Columns to Rows in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298211#M70703</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I had a similar scenario where i want to transpose some columns to rows ,where i used tjavaflex to achieve .&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Tjavaflex Details :&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Start code -&amp;nbsp;&lt;/STRONG&gt;Here get the column names which we need to populate in rows and make a for loop with that number, In my case i have 5 columns and i want to transpose last 3 columns ,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;String splitString = row7.toString().substring(row7.toString().indexOf("[")+1,row7.toString().length()-1);&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;String[] arr1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;arr1 = splitString.split(",");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;String[] arr2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;int[] numArr = {2,3,4}; // &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;put the position number (counting from 0) of the columns you want to transpose - for me last 3 cols&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;String temp = "";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;for(int j = 0;j&amp;lt;numArr.length;j++)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;if(j!=numArr.length-1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;temp+=arr1[numArr[j]]+",";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;temp+=arr1[numArr[j]];&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;arr2 = temp.replaceAll("=null","").split(",");&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;for(int i =0 ;i&amp;lt;arr2.length;i++)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;Main Code&lt;/FONT&gt; -&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;Here Populate the two new columns ,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;row8.col_name = arr2[i];&lt;BR /&gt;String temp2 = row7.toString().substring(row7.toString().indexOf(arr2[i]+"="),row7.toString().length()-1)+",";&lt;BR /&gt;row8.col_value = temp2.substring(temp2.indexOf("=")+1,temp2.indexOf(","));&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;End Code&lt;/FONT&gt; -&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;Close the forloop as ' } ' .&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;}&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Test Job" style="width: 614px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LrvB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147429iFBD0B543A5FF61F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LrvB.png" alt="0683p000009LrvB.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Test Job&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schema - fixedFlowInp &amp;amp;amp; tjavaflex" style="width: 988px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lrv7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148105i76F889465EA9C097/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lrv7.png" alt="0683p000009Lrv7.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Schema - fixedFlowInp &amp;amp; tjavaflex&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample Input" style="width: 749px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls5L.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134778iA3DA1E2BC5AFAEA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls5L.png" alt="0683p000009Ls5L.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sample Input&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Achieved Output (Transposed one)" style="width: 578px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls5o.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141517i3B8C140F1C9289C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls5o.png" alt="0683p000009Ls5o.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Achieved Output (Transposed one)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jan 2018 06:38:56 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-24T06:38:56Z</dc:date>
    <item>
      <title>Transpose Columns to Rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298209#M70701</link>
      <description>&lt;P&gt;Hi Talend Folks,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;In my excel have 400 rows and 500 columns are there.&amp;nbsp;&lt;/LI&gt; 
 &lt;LI&gt;I have a input excel source like below screenshot format&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (98).png" style="width: 707px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LrIT.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/146090iEDC59CA159956C3C/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LrIT.png" alt="0683p000009LrIT.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;I need to convert data like below screenshot format using talend tool.&lt;/LI&gt; 
 &lt;LI&gt;Expected Output.&lt;/LI&gt; 
&lt;/UL&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot (99).png" style="width: 369px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LrSI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154130iC98F0864A00A0C53/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LrSI.png" alt="0683p000009LrSI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;UL&gt; 
 &lt;LI&gt;Please tell me how to Transpose Columns to Rows data above screenshots.&lt;/LI&gt; 
&lt;/UL&gt;</description>
      <pubDate>Thu, 19 Oct 2017 08:23:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298209#M70701</guid>
      <dc:creator>RAJ6</dc:creator>
      <dc:date>2017-10-19T08:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns to Rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298210#M70702</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Talend and similar ETL tools are very much about dealing with fixed, structured data, and&amp;nbsp;the standard components are geared up for this.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;In this case, there&amp;nbsp;are presumably a dynamic number of columns, and the column headings are going to change, which means these standard components and standard approaches aren't suitable.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;As I've explained in your other thread regarding the column names in Talend, you also won't be able to use the dates in your spreadsheet as columns within your job.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Assuming you can't just pivot this in Excel itself, which is very quick and easy to do,&amp;nbsp;then you will either require custom code in a tJavaFlex component,&amp;nbsp;or maybe a custom component.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Take a look on Talend Exchange (&lt;A href="https://exchange.talend.com/" target="_self" rel="nofollow noopener noreferrer"&gt;https://exchange.talend.com/&lt;/A&gt;) and see if there's something suitable.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 10:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298210#M70702</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-19T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns to Rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298211#M70703</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I had a similar scenario where i want to transpose some columns to rows ,where i used tjavaflex to achieve .&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Tjavaflex Details :&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;Start code -&amp;nbsp;&lt;/STRONG&gt;Here get the column names which we need to populate in rows and make a for loop with that number, In my case i have 5 columns and i want to transpose last 3 columns ,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;String splitString = row7.toString().substring(row7.toString().indexOf("[")+1,row7.toString().length()-1);&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;String[] arr1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;arr1 = splitString.split(",");&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;String[] arr2;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;int[] numArr = {2,3,4}; // &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;put the position number (counting from 0) of the columns you want to transpose - for me last 3 cols&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;String temp = "";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;for(int j = 0;j&amp;lt;numArr.length;j++)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;if(j!=numArr.length-1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;temp+=arr1[numArr[j]]+",";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;temp+=arr1[numArr[j]];&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;}&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;arr2 = temp.replaceAll("=null","").split(",");&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;for(int i =0 ;i&amp;lt;arr2.length;i++)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;{&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;Main Code&lt;/FONT&gt; -&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;Here Populate the two new columns ,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;row8.col_name = arr2[i];&lt;BR /&gt;String temp2 = row7.toString().substring(row7.toString().indexOf(arr2[i]+"="),row7.toString().length()-1)+",";&lt;BR /&gt;row8.col_value = temp2.substring(temp2.indexOf("=")+1,temp2.indexOf(","));&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;FONT size="3"&gt;End Code&lt;/FONT&gt; -&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2"&gt;Close the forloop as ' } ' .&lt;/FONT&gt;&lt;/P&gt; 
&lt;P&gt;&lt;FONT size="2"&gt;}&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Test Job" style="width: 614px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LrvB.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147429iFBD0B543A5FF61F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LrvB.png" alt="0683p000009LrvB.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Test Job&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Schema - fixedFlowInp &amp;amp;amp; tjavaflex" style="width: 988px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Lrv7.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/148105i76F889465EA9C097/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Lrv7.png" alt="0683p000009Lrv7.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Schema - fixedFlowInp &amp;amp; tjavaflex&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sample Input" style="width: 749px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls5L.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/134778iA3DA1E2BC5AFAEA8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls5L.png" alt="0683p000009Ls5L.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sample Input&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Achieved Output (Transposed one)" style="width: 578px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009Ls5o.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141517i3B8C140F1C9289C2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009Ls5o.png" alt="0683p000009Ls5o.png" /&gt;&lt;/span&gt;&lt;SPAN class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Achieved Output (Transposed one)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jan 2018 06:38:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298211#M70703</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-24T06:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns to Rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298212#M70704</link>
      <description>&lt;P&gt;The simple solution for this is use tUnpivotRow(from talend exchage)&lt;/P&gt;&lt;P&gt;follow the link for its explanation&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.datalytyx.com/how-to-denormalise-a-dataset-using-talends-tunpivotrow/" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.datalytyx.com/how-to-denormalise-a-dataset-using-talends-tunpivotrow/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2019 13:15:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298212#M70704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-04-11T13:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns to Rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298213#M70705</link>
      <description>&lt;P&gt;tUnPivotRow is NOT compatible with Talend Studio 8&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 10:30:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298213#M70705</guid>
      <dc:creator>fjblau</dc:creator>
      <dc:date>2022-12-19T10:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Transpose Columns to Rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298214#M70706</link>
      <description>&lt;P&gt;You can use the component tFileExcelSheetInput together with tFileExcelSheetInputUnpivot.&lt;/P&gt;&lt;P&gt;https://github.com/jlolling/talendcomp_tFileExcel/blob/master/doc/tFileExcelSheetInput.pdf&lt;/P&gt;&lt;P&gt;These components are part of the well known excel components tFileExcel* component suite.&lt;/P&gt;&lt;P&gt;It allows also to have a variable number of columns and you do not have to deal with the massive amount of columns at all. Everything is done automatically.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 18:04:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Transpose-Columns-to-Rows/m-p/2298214#M70706</guid>
      <dc:creator>jlolling</dc:creator>
      <dc:date>2022-12-19T18:04:40Z</dc:date>
    </item>
  </channel>
</rss>

