<?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: Normalize multiple columns in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334893#M103510</link>
    <description>tJava run for each row you need 1row --&amp;gt; 3 row !</description>
    <pubDate>Mon, 20 Aug 2018 14:42:53 GMT</pubDate>
    <dc:creator>fdenis</dc:creator>
    <dc:date>2018-08-20T14:42:53Z</dc:date>
    <item>
      <title>Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334891#M103508</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need to normalize multiple columns.&lt;/P&gt;
&lt;P&gt;Below is my data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID| Col1| Col2&lt;/P&gt;
&lt;P&gt;1 |a,b,c |d,e,f&lt;/P&gt;
&lt;P&gt;2&amp;nbsp;&lt;SPAN&gt;|g,h,i |j,k,l&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expected result&lt;/P&gt;
&lt;P&gt;ID| Col1| Col2&lt;/P&gt;
&lt;P&gt;1 |a | d&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1 |b | e&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1 |c | f&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;|g | j&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;|h | k&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2&amp;nbsp;| i | l&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below is my try,&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;String[] value1 = input_row.newColumn.split(",");
String[] value2 = input_row.newColumn1.split(",");
int index = input_row.dummy-1;
for(int i= 0; i&amp;lt;value1.length;i++){
for(int j= i; j&amp;lt;=i;j++){
	System.out.println(" Id="+input_row.dummy+"  Col1="+value1[i]+"  Col2="+value2[j]);	

output_row.dummy = input_row.dummy;
output_row.newColumn = value1[i];
output_row.newColumn1 = value2[j];		
	}
}&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;While printing the statement,&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;System.out.println(" Id="+input_row.dummy+"  Col1="+value1[i]+"  Col2="+value2[j]);&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;array is providing four results as expected.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But while passing to the output_row, only the last array is passed. Only one entry is avaliable in the result.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Could any one help out?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below is the flow,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Inpit - &amp;gt; tjavarow -&amp;gt; output&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2018 13:37:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334891#M103508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-08-20T13:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334892#M103509</link>
      <description>you have to use tjavaFlex.</description>
      <pubDate>Mon, 20 Aug 2018 14:41:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334892#M103509</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-08-20T14:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334893#M103510</link>
      <description>tJava run for each row you need 1row --&amp;gt; 3 row !</description>
      <pubDate>Mon, 20 Aug 2018 14:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334893#M103510</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-08-20T14:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334894#M103511</link>
      <description>did you want 9 row?&lt;BR /&gt;1 |a | d&lt;BR /&gt;1 |b | d&lt;BR /&gt;1 |c | d&lt;BR /&gt;1 |a | e&lt;BR /&gt;1 |b | e&lt;BR /&gt;1 |c | e&lt;BR /&gt;1 |a | f&lt;BR /&gt;1 |b | f&lt;BR /&gt;1 |c | f&lt;BR /&gt;in this case you can use tNormalize.&lt;BR /&gt;Regards,</description>
      <pubDate>Mon, 20 Aug 2018 14:46:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334894#M103511</guid>
      <dc:creator>fdenis</dc:creator>
      <dc:date>2018-08-20T14:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334895#M103512</link>
      <description>&lt;P&gt;Hello&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Your try is upto mark&lt;SPAN&gt;, Make use of tmap component to generate the sequence and use as index and then assign to col2.&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN&gt;Tjavarow logic:&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;String[] values2 = input_row.COL2.split(",");&lt;BR /&gt;int index = input_row.seq - 1;&lt;/P&gt; 
&lt;P&gt;output_row.ID = input_row.ID;&lt;BR /&gt;output_row.COL1 = input_row.COL1;&lt;BR /&gt;output_row.COL2 = values2[index];&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="normalize.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LzkH.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154738i2B72CB0962EB2C40/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LzkH.png" alt="0683p000009LzkH.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Hope this helps your purpose.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards&lt;/P&gt; 
&lt;P&gt;Ganshyam&lt;/P&gt;</description>
      <pubDate>Sat, 06 Oct 2018 07:01:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334895#M103512</guid>
      <dc:creator>Ganshyam</dc:creator>
      <dc:date>2018-10-06T07:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334896#M103513</link>
      <description>&lt;P&gt;It works... Great&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 15:03:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334896#M103513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-07T15:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334897#M103514</link>
      <description>&lt;P&gt;Hi Ganshyam,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried the java code you had provided in tjavarow using the following steps but i am getting&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;java.lang.ArrayIndexOutOfBoundsException: -1&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;i am also attaching the screenshots for the tmap and tjavarow components which i have used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009LwIw"&gt;normolize multi columns.docx&lt;/A&gt;</description>
      <pubDate>Fri, 19 Jul 2019 13:02:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334897#M103514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-19T13:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334898#M103515</link>
      <description>&lt;P&gt;Hi, you can use this way :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000G4mE8AAJ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142792i356AD23ECA3A3809/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000G4mE8AAJ.jpg" alt="0695b00000G4mE8AAJ.jpg" /&gt;&lt;/span&gt;my data is :&lt;/P&gt;&lt;P&gt;lang = "EN,FR"&lt;/P&gt;&lt;P&gt;label = "sweatshirt,pull"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;in the tJavaRow: &lt;/B&gt;&lt;/P&gt;&lt;P&gt;String [] listing_lang = {""};&lt;/P&gt;&lt;P&gt;String [] listing_label = {""};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;listing_lang = input_row.lang.split(",");&lt;/P&gt;&lt;P&gt;listing_label = input_row.label.split(",");;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;nb = StringHandling.COUNT(input_row.lang, ",");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;in the tJavaFlex :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0695b00000G4mFBAAZ.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/147982iBC171AF8E88D26EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0695b00000G4mFBAAZ.jpg" alt="0695b00000G4mFBAAZ.jpg" /&gt;&lt;/span&gt;row9 being the out of my tJavaFlex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 08:43:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2334898#M103515</guid>
      <dc:creator>GRomain</dc:creator>
      <dc:date>2021-06-15T08:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Normalize multiple columns</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2513177#M147428</link>
      <description>&lt;P&gt;Though this query is a few years old, it helped point me in the right direction.&lt;/P&gt;&lt;P&gt;You can actually achieve everything after the initial normalization within a tMap, you don't need a tJavaRow or anything.&lt;/P&gt;&lt;P&gt;My tMap looks like&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Underdown_0-1743778836079.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179381iA954155A4C322A3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="David_Underdown_0-1743778836079.png" alt="David_Underdown_0-1743778836079.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and my overall job flow is&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="David_Underdown_1-1743778883001.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179382i80C678A393E57DA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="David_Underdown_1-1743778883001.png" alt="David_Underdown_1-1743778883001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The initial tJavaRow uses String split using the same separator used for normalization to check that there are the same number of items within the two fields to be normalized, since otherwise it would not be clear how to align the fields. It will throw an&amp;nbsp;&lt;SPAN&gt;IllegalArgumentException if the lengths of the two string arrays created by splitting the fields are not equal. If they are equal it just passes through the data on the row&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;String [] firstColumnArray = input_row.firstColumnToNormalize.split(context.parameter_separator_regex);
String [] secondColumnArray = input_row.secondColumnToNormalize.split(context.parameter_separator_regex);

if (firstColumnArray.length == secondColumnArray.length) {
	output_row.rowNumber = input_row.rowNumber;
	output_row.firstColumnToNormalize = input_row.firstColumnToNormalize;
	output_row.secondColumnToNormalize = input_row.secondColumnToNormalize;
} else {
	throw new IllegalArgumentException("firstColumnToNormalize and secondColumnToNormalise must have the same number of items in them");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the key in the tMap is that a new sequence is created each time the value in the first column changes, this is done by setting the sequence name to be the value of the first column. making the sequence start at zero means we can immediately use is as the row index after splitting the second column of interest.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Apr 2025 15:07:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Normalize-multiple-columns/m-p/2513177#M147428</guid>
      <dc:creator>David_Underdown</dc:creator>
      <dc:date>2025-04-04T15:07:29Z</dc:date>
    </item>
  </channel>
</rss>

