<?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: Flatten hierarchy - Iteration on left outer join in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310550#M81661</link>
    <description>&lt;P&gt;The link you have provided is not working. Can I see the solution in any other ways ?&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2020 20:27:05 GMT</pubDate>
    <dc:creator>prabinpatroc1</dc:creator>
    <dc:date>2020-02-10T20:27:05Z</dc:date>
    <item>
      <title>Flatten hierarchy - Iteration on left outer join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310548#M81659</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;I have a table (from json) which have 3 columns:&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;id&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; description&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; parent_id&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;001&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Toys&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;(NULL)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;002&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; Vehicles&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;001&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;003&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Cars&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;002&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;...&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to flatten this hierarchy structure.&lt;/P&gt;&lt;P&gt;One way I can think of, is first doing self join on the parent_id and id, then keep doing left outer join with the original table, until the output with the last column all NULL.&lt;/P&gt;&lt;P&gt;The result should look like the below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;id&amp;nbsp; &amp;nbsp; |&amp;nbsp; description&amp;nbsp; |&amp;nbsp; parent_id&amp;nbsp; |&amp;nbsp; &amp;nbsp;parent_id_1&amp;nbsp; |&amp;nbsp; &amp;nbsp;parent_id_2&amp;nbsp; |&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;001&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; Toys&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; (NULL)&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;(NULL)&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;(NULL)&amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;002&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Vehicles&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;001&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;(NULL)&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;(NULL)&amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;003&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; Cars&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;002&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;001&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;(NULL)&amp;nbsp; &amp;nbsp; &amp;nbsp;|&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;...&amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp;...&amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can do this in Talend? Or is there any other easier way to flatten such hierarchy?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 03:11:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310548#M81659</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-18T03:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Flatten hierarchy - Iteration on left outer join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310549#M81660</link>
      <description>&lt;P&gt;I wrote this a long time ago as an experiment (&lt;A href="https://www.rilhia.com/tutorials/talend-connect-example" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.rilhia.com/tutorials/talend-connect-example&lt;/A&gt;). It is very much along the same lines as what you are attempting. It may work, but it is tricky and was only written to see if I could do it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem you have is that you need to use recursion for this and that is something Talend doesn't handle all that well. You *could* write a recursive routine to do this and return a comma separated list representing your hierarchy. After that you would split that up into different columns using a tMap. I'd probably opt for something like that if I had to do solely inside Talend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another way to do it would be to load the data into Oracle and carry out a connect by prior query. Of course that only works if you have the environment to do it that way.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2018 23:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310549#M81660</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-18T23:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Flatten hierarchy - Iteration on left outer join</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310550#M81661</link>
      <description>&lt;P&gt;The link you have provided is not working. Can I see the solution in any other ways ?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2020 20:27:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Flatten-hierarchy-Iteration-on-left-outer-join/m-p/2310550#M81661</guid>
      <dc:creator>prabinpatroc1</dc:creator>
      <dc:date>2020-02-10T20:27:05Z</dc:date>
    </item>
  </channel>
</rss>

