<?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: Using path enumerated hierarchies in Qlik Sense in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974488#M14031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this data set, you can just parse out the parent id from the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[regions]:&lt;/P&gt;&lt;P&gt;Hierarchy(NodeID,Parent,Name)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NodeID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Path,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(Path,'/', SubStringCount(Path,'/')) as Parent&lt;/P&gt;&lt;P&gt;inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;NodeID, Path, Name&lt;/P&gt;&lt;P&gt;1, 1, The World&lt;/P&gt;&lt;P&gt;20, 1/20, Americas&lt;/P&gt;&lt;P&gt;79, 1/20/79, United States&lt;/P&gt;&lt;P&gt;85, 1/20/79/85, California&lt;/P&gt;&lt;P&gt;90, 1/20/79/85/90, Napa Valley&lt;/P&gt;&lt;P&gt;178, 1/178, Europe&lt;/P&gt;&lt;P&gt;281, 1/178/281, France&lt;/P&gt;&lt;P&gt;283, 1/178/281/283, Bordeaux&lt;/P&gt;&lt;P&gt;288, 1/178/281/283/288, Medoc&lt;/P&gt;&lt;P&gt;294, 1/178/281/283/288/294, Haut-Medoc&lt;/P&gt;&lt;P&gt;354, 1/178/354, Germany&lt;/P&gt;&lt;P&gt;368, 1/178/354/368, Rheingau&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a somewhat synthetic example, however, where the materialized path is constructed of unique ids at every stage. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an alternative, more general case, consider a listing of a filesystem, where you have two columns, the path to the file and the size of the file.&amp;nbsp; Here there is no nodeid precalculated and the parent.&amp;nbsp; Say we want to display total size by directory, or show a treemap of size by directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a solution for this general case where there are no unique ids outside of the materialized path?&amp;nbsp; That is to say, other then the alternative of pre-processing the list outside of Qlik into an adjacent nodes table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Oct 2015 17:41:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-27T17:41:18Z</dc:date>
    <item>
      <title>Using path enumerated hierarchies in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974486#M14029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am reading about hierarchies from &lt;A href="https://community.qlik.com/docs/DOC-5334"&gt;Hierarchies&lt;/A&gt;‌. ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the &lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/download/5334-4-81955/Hierarchies.pdf"&gt;PDF &lt;/A&gt;attached to that article, it discussed several ways of storing hierarchical data, of one which is path enumeration.&amp;nbsp; Consider the data in the following table from the PDF, which is an n-level unbalanced tree:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;NodeID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Path&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Name&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;The World&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Americas&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;79&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/20/79&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;United States&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;85&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/20/79/85&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;California&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;90&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/20/79/85/90&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Napa Valley&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;178&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Europe&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;281&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178/281&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;France&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;283&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178/281/283&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Bordeaux&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;288&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178/281/283/288&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Medoc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;294&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178/281/283/288/294&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Haut-Medoc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;354&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178/354&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Germany&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;368&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1/178/354/368&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Rheingau&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's clear that this table isn't usable directly for analysis.&amp;nbsp; To quote the PDF again:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Also this table completely defines the hierarchy, and also here the table needs to be transformed to be usable in QlikView."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the PDF doesn't say how to transform a path enumerated table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are two functions available in load scripts: &lt;A href="http://help.qlik.com/sense/2.1/en-US/online/#../Subsystems/Hub/Content/Scripting/ScriptPrefixes/Hierarchy.htm"&gt;Hierarchy&lt;/A&gt; and &lt;A href="http://help.qlik.com/sense/2.1/en-US/online/#../Subsystems/Hub/Content/Scripting/ScriptPrefixes/HierarchyBelongsTo.htm"&gt;HierarchyBelongsTo&lt;/A&gt;.&amp;nbsp; Both, however, have a required parent id column, which is not explicit in the path enumerated list?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does one transform a n-level unbalanced tree expressed in a path enumerated table into an expanded nodes table with a column for each path step?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Related question, the Hierarchy function takes an option &lt;SPAN class="bnf_token"&gt;PathName, but there isn't an example using this parameter.&amp;nbsp; What is a good example of such a use-case?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 16:23:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974486#M14029</guid>
      <dc:creator />
      <dc:date>2015-10-27T16:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using path enumerated hierarchies in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974487#M14030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Inline data for the aforementioned table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[regions]:&lt;/P&gt;&lt;P&gt;LOAD * inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;NodeID, Path, Name&lt;/P&gt;&lt;P&gt;1, 1, The World&lt;/P&gt;&lt;P&gt;20, 1/20, Americas&lt;/P&gt;&lt;P&gt;79, 1/20/79, United States&lt;/P&gt;&lt;P&gt;85, 1/20/79/85, California&lt;/P&gt;&lt;P&gt;90, 1/20/79/85/90, Napa Valley&lt;/P&gt;&lt;P&gt;178, 1/178, Europe&lt;/P&gt;&lt;P&gt;281, 1/178/281, France&lt;/P&gt;&lt;P&gt;283, 1/178/281/283, Bordeaux&lt;/P&gt;&lt;P&gt;288, 1/178/281/283/288, Medoc&lt;/P&gt;&lt;P&gt;294, 1/178/281/283/288/294, Haut-Medoc&lt;/P&gt;&lt;P&gt;354, 1/178/354, Germany&lt;/P&gt;&lt;P&gt;368, 1/178/354/368, Rheingau&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 16:35:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974487#M14030</guid>
      <dc:creator />
      <dc:date>2015-10-27T16:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using path enumerated hierarchies in Qlik Sense</title>
      <link>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974488#M14031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this data set, you can just parse out the parent id from the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[regions]:&lt;/P&gt;&lt;P&gt;Hierarchy(NodeID,Parent,Name)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NodeID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Path,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField(Path,'/', SubStringCount(Path,'/')) as Parent&lt;/P&gt;&lt;P&gt;inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;NodeID, Path, Name&lt;/P&gt;&lt;P&gt;1, 1, The World&lt;/P&gt;&lt;P&gt;20, 1/20, Americas&lt;/P&gt;&lt;P&gt;79, 1/20/79, United States&lt;/P&gt;&lt;P&gt;85, 1/20/79/85, California&lt;/P&gt;&lt;P&gt;90, 1/20/79/85/90, Napa Valley&lt;/P&gt;&lt;P&gt;178, 1/178, Europe&lt;/P&gt;&lt;P&gt;281, 1/178/281, France&lt;/P&gt;&lt;P&gt;283, 1/178/281/283, Bordeaux&lt;/P&gt;&lt;P&gt;288, 1/178/281/283/288, Medoc&lt;/P&gt;&lt;P&gt;294, 1/178/281/283/288/294, Haut-Medoc&lt;/P&gt;&lt;P&gt;354, 1/178/354, Germany&lt;/P&gt;&lt;P&gt;368, 1/178/354/368, Rheingau&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a somewhat synthetic example, however, where the materialized path is constructed of unique ids at every stage. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For an alternative, more general case, consider a listing of a filesystem, where you have two columns, the path to the file and the size of the file.&amp;nbsp; Here there is no nodeid precalculated and the parent.&amp;nbsp; Say we want to display total size by directory, or show a treemap of size by directory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a solution for this general case where there are no unique ids outside of the materialized path?&amp;nbsp; That is to say, other then the alternative of pre-processing the list outside of Qlik into an adjacent nodes table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 17:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-path-enumerated-hierarchies-in-Qlik-Sense/m-p/974488#M14031</guid>
      <dc:creator />
      <dc:date>2015-10-27T17:41:18Z</dc:date>
    </item>
  </channel>
</rss>

