<?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: Hierarchy - how to concatenate tables with different depth nodes in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360094#M705307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Kuba, thank you Henric. It did the job. One thing for future readers, though - when doing hierarchy transformation join account and parent id with db, otherwise hierarchy will go wild.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Mar 2012 16:21:33 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-03-26T16:21:33Z</dc:date>
    <item>
      <title>Hierarchy - how to concatenate tables with different depth nodes</title>
      <link>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360091#M705303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using below code I mean to get chart of accounts from several tables. All tables have identical structure, only node depth changes - all tables node depth is 3, one's node depth is 5. After reload, instead of desired one table Accounts I arrive with three tables: Accounts, Accounts-Expanded Nodes and $Syn. What could be done to get one table one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;DBS:&lt;/P&gt;&lt;P&gt;SELECT DB_Name FROM Configuration;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Accounts:&lt;/P&gt;&lt;P&gt;LET NoOfDBS = NoOfRows('DBS');&lt;/P&gt;&lt;P&gt;FOR i=0 TO $(NoOfDBS)-1&lt;/P&gt;&lt;P&gt;LET DB_Name = peek('DB_Name',$(i),'DBS');&lt;/P&gt;&lt;P&gt;HIERARCHY(Acc_AccId, Acc_ParId, Acc_Name)&lt;/P&gt;&lt;P&gt;SELECT &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'$(DB_Name)' AS DB_Name, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Acc_Type, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Acc_Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Acc_AccId, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Acc_ParId&lt;/P&gt;&lt;P&gt;FROM CDN_$(DB_Name).CDN.Accounts;&lt;/P&gt;&lt;P&gt;NEXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 13:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360091#M705303</guid>
      <dc:creator />
      <dc:date>2012-03-20T13:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchy - how to concatenate tables with different depth nodes</title>
      <link>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360092#M705304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure why it ends like that - Accounts-Expanded Nodes is an automatic table created during hierarchy load and shoud get auto-dropped, but probably something goes wrong because of the loop. I would first load the whole adjacent node table (via the loop) and then reload it using hierarchy load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;DBS:&lt;/P&gt;&lt;P&gt;SELECT DB_Name FROM Configuration;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AccountsAdjacent:&lt;/P&gt;&lt;P&gt;LET NoOfDBS = NoOfRows('DBS');&lt;/P&gt;&lt;P&gt;FOR i=0 TO $(NoOfDBS)-1&lt;/P&gt;&lt;P&gt;LET DB_Name = peek('DB_Name',$(i),'DBS');&lt;/P&gt;&lt;P&gt;SELECT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '$(DB_Name)' AS DB_Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acc_Type,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acc_Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acc_AccId,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Acc_ParId&lt;/P&gt;&lt;P&gt;FROM CDN_$(DB_Name).CDN.Accounts;&lt;/P&gt;&lt;P&gt;NEXT&lt;BR /&gt;&lt;BR /&gt;Accounts:&lt;BR /&gt;HIERARCHY(Acc_AccId, Acc_ParId, Acc_Name)&lt;BR /&gt;LOAD * &lt;BR /&gt;RESIDENT AccountsAdjacent;&lt;BR /&gt;&lt;BR /&gt;DROP TABLE AccountsAdjacent;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 09:09:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360092#M705304</guid>
      <dc:creator>kuba_michalik</dc:creator>
      <dc:date>2012-03-26T09:09:49Z</dc:date>
    </item>
    <item>
      <title>Hierarchy - how to concatenate tables with different depth nodes</title>
      <link>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360093#M705305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Hierarchy prefix makes a transformation that needs the entire Adjacent Nodes table - &lt;SPAN style="text-decoration: underline;"&gt;an output record from this transformation has information from &lt;STRONG&gt;many &lt;/STRONG&gt;of the input records&lt;/SPAN&gt;. So, concatenation of two different Hierarchy prefix statements will lead to unpredictable results. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, Kuba's solution is completely right. First, create the entire Adjacent Nodes table, then do the Hierarchy transformation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 09:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360093#M705305</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-03-26T09:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Hierarchy - how to concatenate tables with different depth nodes</title>
      <link>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360094#M705307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, Kuba, thank you Henric. It did the job. One thing for future readers, though - when doing hierarchy transformation join account and parent id with db, otherwise hierarchy will go wild.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2012 16:21:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Hierarchy-how-to-concatenate-tables-with-different-depth-nodes/m-p/360094#M705307</guid>
      <dc:creator />
      <dc:date>2012-03-26T16:21:33Z</dc:date>
    </item>
  </channel>
</rss>

