<?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 Convert one row fieldset to multiple rows in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229054#M20108</link>
    <description>Hi all,
&lt;BR /&gt;I was wondering if there is a more efficient way to convert a multiple fieldset from one source row into multiple rows for an output.
&lt;BR /&gt;Example:
&lt;BR /&gt;I have a row with the structure
&lt;BR /&gt;key, value-a-1, value-a-2, value-a-3, value-b-1, value-b-2, value-b-3
&lt;BR /&gt;and like to have an row (flow) like
&lt;BR /&gt;key, value-a-1, value-b-1
&lt;BR /&gt;key, value-a-2, value-b-2
&lt;BR /&gt;key, value-a-3, value-b-3
&lt;BR /&gt;My idea is at the moment to use a tMap to split the multiple fieldsets into three different flows for the output. As this is replicating quite some code I was wondering if there is a more efficient or elegant way.
&lt;BR /&gt;Thx for your suggestions
&lt;BR /&gt;Alex</description>
    <pubDate>Sat, 16 Nov 2024 13:23:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T13:23:17Z</dc:date>
    <item>
      <title>Convert one row fieldset to multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229054#M20108</link>
      <description>Hi all,
&lt;BR /&gt;I was wondering if there is a more efficient way to convert a multiple fieldset from one source row into multiple rows for an output.
&lt;BR /&gt;Example:
&lt;BR /&gt;I have a row with the structure
&lt;BR /&gt;key, value-a-1, value-a-2, value-a-3, value-b-1, value-b-2, value-b-3
&lt;BR /&gt;and like to have an row (flow) like
&lt;BR /&gt;key, value-a-1, value-b-1
&lt;BR /&gt;key, value-a-2, value-b-2
&lt;BR /&gt;key, value-a-3, value-b-3
&lt;BR /&gt;My idea is at the moment to use a tMap to split the multiple fieldsets into three different flows for the output. As this is replicating quite some code I was wondering if there is a more efficient or elegant way.
&lt;BR /&gt;Thx for your suggestions
&lt;BR /&gt;Alex</description>
      <pubDate>Sat, 16 Nov 2024 13:23:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229054#M20108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Convert one row fieldset to multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229055#M20109</link>
      <description>Use a lookup table for your tMap containing one column and three rows with the values "1", "2" and "3" but don't link the main input table to the lookup table. This will give you three output rows for each input row and you can map the relevant field value depending on the lookup value e.g. lookupFlow.columnName.equals("1")?mainFlow.valueA1:lookupFlow.columnName.equals("2")?mainFlow.valueA2:mainFlow.valueA3. 
&lt;BR /&gt;See 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCr5KCAS" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Mapping-a-single-row-to-multiple-rows/td-p/113293&lt;/A&gt; for a similar example.</description>
      <pubDate>Thu, 17 Jun 2010 02:20:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229055#M20109</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-06-17T02:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert one row fieldset to multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229056#M20110</link>
      <description>Dear Alevy, 
&lt;BR /&gt;Thanks this is a helpful solution and works. 
&lt;BR /&gt;Do you have a smart idea how to avoid having an if statement for more than 3 different fields? 
&lt;BR /&gt;My idea is to use Java reflection like this to call the fields dynamic. However I'm not sure how to integrate this in the tMap. It doesn't look very simple. 
&lt;BR /&gt;Regards</description>
      <pubDate>Mon, 21 Jun 2010 17:16:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229056#M20110</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-21T17:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert one row fieldset to multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229057#M20111</link>
      <description>I don't know Java so have no idea what reflection is. My suggestion above is the best I've come up with although I have seen other suggestions on the forum e.g. 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCtU0CAK" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/How-can-I-splitt-an-inputrow-into-twi-outputrows/td-p/64157&lt;/A&gt;. 
&lt;BR /&gt;Other ideas of mine but not really better: 
&lt;BR /&gt;-- Carry the lookup and main values through tMap as is and assign them to individual fields using a switch statement in tJavaRow. 
&lt;BR /&gt;-- Concatenate your fields in tMap as "value-a-1, value-b-1; value-a-2, value-b-2; value-a-3, value-b-3" then tNormalize on ";" and then tExtractDelimitedFields on "," (e.g. 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCt5hCAC" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/Integrating-Seperate-Columns-in-to-one-Column/td-p/61661&lt;/A&gt; and 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCqWICA0" target="_blank" rel="nofollow noopener noreferrer"&gt;https://community.talend.com/t5/Design-and-Development/resolved-Split-a-single-row-to-multiple-rows-CSV-File/td-p/109423&lt;/A&gt;).</description>
      <pubDate>Tue, 22 Jun 2010 00:02:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229057#M20111</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2010-06-22T00:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Convert one row fieldset to multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229058#M20112</link>
      <description>Dear Alevy, 
&lt;BR /&gt;First off - your first solution is perfect! 
&lt;BR /&gt;It works and does exactly what it is supposed to do. 
&lt;BR /&gt;I think the tJavaRow &amp;amp; switch is quite similar what we can achieve with the if statement. However the tJavaRow can organize a reflection style approach what I was looking for. 
&lt;BR /&gt;The reflection in Java allows you to dynamically access attributes of a class or methods. It is a bit similar like using PHP with 
&lt;BR /&gt;$fieldName ="value-a-" + lookupRow-&amp;gt;code; 
&lt;BR /&gt;$value = $row-&amp;gt;$fieldName; 
&lt;BR /&gt;In Java you need to do a work around using a method and then invoke the method instance. Its a bit more code but will work quite similar. 
&lt;BR /&gt;Thank's again for your help - your solution worked for me 
&lt;BR /&gt;Alex</description>
      <pubDate>Tue, 22 Jun 2010 08:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229058#M20112</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-06-22T08:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Convert one row fieldset to multiple rows</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229059#M20113</link>
      <description>From v4.2.0, the tSplitRow component handles this very well.&lt;BR /&gt;And joined outputs in tMap can be even better since you can drag and drop.  tSplitRow is a pain to use.</description>
      <pubDate>Sun, 12 Jun 2011 03:29:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Convert-one-row-fieldset-to-multiple-rows/m-p/2229059#M20113</guid>
      <dc:creator>alevy</dc:creator>
      <dc:date>2011-06-12T03:29:15Z</dc:date>
    </item>
  </channel>
</rss>

