<?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: Executing of values till leaf node. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230772#M392226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14834362201066578" jivemacro_uid="_14834362201066578"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;input:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Stem,Leaf&lt;/P&gt;
&lt;P&gt;A,A1&lt;/P&gt;
&lt;P&gt;B,B1&lt;/P&gt;
&lt;P&gt;B,B2&lt;/P&gt;
&lt;P&gt;C,C1&lt;/P&gt;
&lt;P&gt;D,D1&lt;/P&gt;
&lt;P&gt;B1,B2&lt;/P&gt;
&lt;P&gt;B1,B3&lt;/P&gt;
&lt;P&gt;C1,C2&lt;/P&gt;
&lt;P&gt;D1,D2&lt;/P&gt;
&lt;P&gt;C2,C3&lt;/P&gt;
&lt;P&gt;D2,D3&lt;/P&gt;
&lt;P&gt;D3,D4&lt;/P&gt;
&lt;P&gt;D4,D5&lt;/P&gt;
&lt;P&gt;D4,D6&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;left join (input)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;values:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Leaf, Value&lt;/P&gt;
&lt;P&gt;A1, 10&lt;/P&gt;
&lt;P&gt;B1, 20&lt;/P&gt;
&lt;P&gt;C1, 30&lt;/P&gt;
&lt;P&gt;D1, 40&lt;/P&gt;
&lt;P&gt;B2, 50&lt;/P&gt;
&lt;P&gt;C2, 60&lt;/P&gt;
&lt;P&gt;D2, 70&lt;/P&gt;
&lt;P&gt;C3, 80&lt;/P&gt;
&lt;P&gt;D3, 90&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//cheat using the hierarchy belongs to to sus out our layers&lt;/P&gt;
&lt;P&gt;HierarchyBelongsTo:&lt;/P&gt;
&lt;P&gt;HierarchyBelongsTo (Node, Parent, NodeName, AncestorID, AncestorName, DepthDiff)&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Leaf as Node ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Leaf as NodeName,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Stem as Parent&lt;/P&gt;
&lt;P&gt;resident input;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//create a layers table to we can figure out which layer we want to load &lt;/P&gt;
&lt;P&gt;LEFT JOIN (input)&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT Node as Leaf, max(DepthDiff)+1 as MaxDepth &lt;/P&gt;
&lt;P&gt;Resident HierarchyBelongsTo&lt;/P&gt;
&lt;P&gt;GROUP BY Node;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//figure out our max depth we need to work to&lt;/P&gt;
&lt;P&gt;MaxLayers:&lt;/P&gt;
&lt;P&gt;LOAD max(MaxDepth) as MaxLayers&lt;/P&gt;
&lt;P&gt;resident input;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET vLayers = peek('MaxLayers');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//drop working table&lt;/P&gt;
&lt;P&gt;DROP TABLE MaxLayers;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//LOAD our top layer which won't have a record in the layers table&lt;/P&gt;
&lt;P&gt;HierarchyMain:&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT Stem as Layer0 &lt;/P&gt;
&lt;P&gt;resident input&lt;/P&gt;
&lt;P&gt;WHERE NOT EXISTS (Node,Stem);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//now run our loop&lt;/P&gt;
&lt;P&gt;for i=1 to $(vLayers)&lt;/P&gt;
&lt;P&gt;let x = $(i)-1;&lt;/P&gt;
&lt;P&gt;LEFT JOIN (HierarchyMain) &lt;/P&gt;
&lt;P&gt;LOAD Stem as 'Layer$(x)',Leaf as 'Layer$(i)', Value as 'Value$(i)'&lt;/P&gt;
&lt;P&gt;resident input&lt;/P&gt;
&lt;P&gt;WHERE MaxDepth = $(i) ;&lt;/P&gt;
&lt;P&gt;next i;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//drop working table&lt;/P&gt;
&lt;P&gt;DROP TABLE HierarchyBelongsTo;&lt;/P&gt;
&lt;P&gt;DROP TABLE input;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jan 2017 09:37:12 GMT</pubDate>
    <dc:creator>adamdavi3s</dc:creator>
    <dc:date>2017-01-03T09:37:12Z</dc:date>
    <item>
      <title>Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230762#M392216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Dear Experts,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;This are my input tables&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Input Table:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 146px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Stem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Leaf&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;A1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;B1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;C1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;D&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;D1&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;B1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;B2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;C1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;C2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;D1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;D2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;C2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;C3&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;D2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="73"&gt;&lt;SPAN style="color: #000000;"&gt;D3&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have given to analyse for Stem (A,B,C,D) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Step 1&lt;/STRONG&gt;- I need to find Leaf value of Stem &lt;SPAN style="font-size: 13.3333px;"&gt;(A,B,C,D)&amp;nbsp; i.e (A1,B1,C1,D1) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #000000;"&gt;&lt;STRONG&gt;Step 2&lt;/STRONG&gt;- Find these values in Stem &amp;amp; corresponding leaf values &lt;SPAN style="font-size: 13.3333px;"&gt;i.e (B2,C2,D2)&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px; color: #000000;"&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;- If corresponding value is not found&amp;nbsp; in Step 2 like for A1 then its &lt;STRONG&gt;null&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Above steps should be performed till all leaf are found in loop with first iteration as &lt;STRONG&gt;Level2 &lt;/STRONG&gt;then &lt;STRONG&gt;Level 3&lt;/STRONG&gt; &amp;amp; so on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt; Data Table&lt;/STRONG&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 128px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Leaf&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;A1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;10&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;B1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;20&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;C1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;30&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;D1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;40&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;B2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;50&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;C2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;60&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;D2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;70&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;C3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;80&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;D3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;90&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;The Result should be look like this, so that we will be able to make a drill group with all levels &amp;amp; get corresponding values as shown:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&amp;nbsp; &lt;STRONG&gt;Output :&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 448px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Level0&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Level1&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Level2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Level3&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Value&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;&lt;SPAN style="color: #000000;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;A1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;10&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;&lt;SPAN style="color: #000000;"&gt;B&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;B1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;B2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;50&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;&lt;SPAN style="color: #000000;"&gt;C&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;C1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;C2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;C3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;80&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="border-top: none;"&gt;&lt;SPAN style="color: #000000;"&gt;D&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;D1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;D2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;-&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;D3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none; border-left: none;"&gt;&lt;SPAN style="color: #000000;"&gt;90&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #000000; text-decoration: underline;"&gt;&lt;EM&gt;'I have tried using left join to make Level but the logic failed at Level 2.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/H4&gt;&lt;H4&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #000000; text-decoration: underline;"&gt;&lt;EM&gt;Also I m not able to retain null values as in above Note'&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #000000; text-decoration: underline;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks &amp;amp; Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Ahmar&lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #000000; text-decoration: underline;"&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 11:47:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230762#M392216</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2016-12-23T11:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230763#M392217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the hierarchy function to create a table with that layout. See this blog post: &lt;A href="https://community.qlik.com/qlik-blogpost/3433"&gt;Unbalanced, n-level hierarchies&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 11:54:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230763#M392217</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-12-23T11:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230764#M392218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gysbert &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have read the blog post but it already has a required data.&lt;/P&gt;&lt;P&gt;In my case I need to make the data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;appreciate your help&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 12:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230764#M392218</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2016-12-23T12:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230765#M392219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I thought you said you already had an input table. I can't help you generate that if you don't.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 12:32:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230765#M392219</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-12-23T12:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230766#M392220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will generate your code table&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14824983948572731 jive_text_macro" jivemacro_uid="_14824983948572731" modifiedtitle="true"&gt;
&lt;P&gt;nodemap:&lt;/P&gt;
&lt;P&gt;Mapping load * inline [&lt;/P&gt;
&lt;P&gt;Stem,Leaf&lt;/P&gt;
&lt;P&gt;A,A1&lt;/P&gt;
&lt;P&gt;B,B1&lt;/P&gt;
&lt;P&gt;C,C1&lt;/P&gt;
&lt;P&gt;D,D1&lt;/P&gt;
&lt;P&gt;B1,B2&lt;/P&gt;
&lt;P&gt;C1,C2&lt;/P&gt;
&lt;P&gt;D1,D2&lt;/P&gt;
&lt;P&gt;C2,C3&lt;/P&gt;
&lt;P&gt;D2,D3&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hierarchy:&lt;/P&gt;
&lt;P&gt;load Level0, Level1,Level2, applymap('nodemap',Level2,null()) as Level3;&lt;/P&gt;
&lt;P&gt;load Level0, Level1, applymap('nodemap',Level1,null()) as Level2;&lt;/P&gt;
&lt;P&gt;load Input as Level0, applymap('nodemap',Input,null()) as Level1;&lt;/P&gt;
&lt;P&gt;LOAD * inline [&lt;/P&gt;
&lt;P&gt;Input&lt;/P&gt;
&lt;P&gt;A&lt;/P&gt;
&lt;P&gt;B&lt;/P&gt;
&lt;P&gt;C&lt;/P&gt;
&lt;P&gt;D&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Dec 2016 13:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230766#M392220</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2016-12-23T13:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230767#M392221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi adam,&lt;/P&gt;&lt;P&gt;your logic was good but when one stem and more than one leaf like &lt;STRONG&gt;Stem B&lt;/STRONG&gt; on below table&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;nodemap:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: black; font-size: 9pt; font-style: inherit; line-height: 1.5em;"&gt;Stem,Leaf&lt;/STRONG&gt;&lt;/P&gt;&lt;OL class="dp-c" start="1" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #5c5c5c; margin: 0 0 1px 45px !important;"&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;A,A1&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;STRONG&gt;B,B1 &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;B,B2&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;C,C1&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;D,D1&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;B1,B2&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;C1,C2&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;D1,D2&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;C2,C3&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;D2,D3&amp;nbsp; &lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; color: black; font-size: 9pt !important; background-color: inherit;"&gt;]; &lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Output for Stem B like below using applymap&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;STRONG&gt;Stem,Leaf&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;B,B1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;appreciate your help&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Dec 2016 04:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230767#M392221</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2016-12-24T04:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230768#M392222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK so your data is NOT a one for one map as per your original example?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 07:26:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230768#M392222</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T07:26:42Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230769#M392223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK give this a crack, I am sure this could be done much more neatly though&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14834338523455917 jive_text_macro" jivemacro_uid="_14834338523455917"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;input:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Stem,Leaf&lt;/P&gt;
&lt;P&gt;A,A1&lt;/P&gt;
&lt;P&gt;B,B1&lt;/P&gt;
&lt;P&gt;B,B2&lt;/P&gt;
&lt;P&gt;C,C1&lt;/P&gt;
&lt;P&gt;D,D1&lt;/P&gt;
&lt;P&gt;B1,B2&lt;/P&gt;
&lt;P&gt;B1,B3&lt;/P&gt;
&lt;P&gt;C1,C2&lt;/P&gt;
&lt;P&gt;D1,D2&lt;/P&gt;
&lt;P&gt;C2,C3&lt;/P&gt;
&lt;P&gt;D2,D3&lt;/P&gt;
&lt;P&gt;D3,D4&lt;/P&gt;
&lt;P&gt;D4,D5&lt;/P&gt;
&lt;P&gt;D4,D6&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//cheat using the hierarchy belongs to to sus out our layers&lt;/P&gt;
&lt;P&gt;HierarchyBelongsTo:&lt;/P&gt;
&lt;P&gt;HierarchyBelongsTo (Node, Parent, NodeName, AncestorID, AncestorName, DepthDiff)&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Leaf as Node ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Leaf as NodeName,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Stem as Parent&lt;/P&gt;
&lt;P&gt;resident input;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//create a layers table to we can figure out which layer we want to load &lt;/P&gt;
&lt;P&gt;LEFT JOIN (input)&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT Node as Leaf, max(DepthDiff)+1 as MaxDepth &lt;/P&gt;
&lt;P&gt;Resident HierarchyBelongsTo&lt;/P&gt;
&lt;P&gt;GROUP BY Node;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//figure out our max depth we need to work to&lt;/P&gt;
&lt;P&gt;MaxLayers:&lt;/P&gt;
&lt;P&gt;LOAD max(MaxDepth) as MaxLayers&lt;/P&gt;
&lt;P&gt;resident input;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET vLayers = peek('MaxLayers');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//drop working table&lt;/P&gt;
&lt;P&gt;DROP TABLE MaxLayers;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//LOAD our top layer which won't have a record in the layers table&lt;/P&gt;
&lt;P&gt;HierarchyMain:&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT Stem as Layer0 &lt;/P&gt;
&lt;P&gt;resident input&lt;/P&gt;
&lt;P&gt;WHERE NOT EXISTS (Node,Stem);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//now run our loop&lt;/P&gt;
&lt;P&gt;for i=1 to $(vLayers)&lt;/P&gt;
&lt;P&gt;let x = $(i)-1;&lt;/P&gt;
&lt;P&gt;LEFT JOIN (HierarchyMain) &lt;/P&gt;
&lt;P&gt;LOAD Stem as 'Layer$(x)',Leaf as 'Layer$(i)'&lt;/P&gt;
&lt;P&gt;resident input&lt;/P&gt;
&lt;P&gt;WHERE MaxDepth = $(i) ;&lt;/P&gt;
&lt;P&gt;next i;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//drop working table&lt;/P&gt;
&lt;P&gt;DROP TABLE HierarchyBelongsTo;&lt;/P&gt;
&lt;P&gt;DROP TABLE input;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 08:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230769#M392223</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T08:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230770#M392224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;hi Adam,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Your logic was perfect for creating layers but we also want corresponding values.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Your logic solved my 99% problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 09:20:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230770#M392224</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2017-01-03T09:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230771#M392225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry yes I see that in the second part of the post. That should be easy to add&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 09:33:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230771#M392225</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T09:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230772#M392226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14834362201066578" jivemacro_uid="_14834362201066578"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;input:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Stem,Leaf&lt;/P&gt;
&lt;P&gt;A,A1&lt;/P&gt;
&lt;P&gt;B,B1&lt;/P&gt;
&lt;P&gt;B,B2&lt;/P&gt;
&lt;P&gt;C,C1&lt;/P&gt;
&lt;P&gt;D,D1&lt;/P&gt;
&lt;P&gt;B1,B2&lt;/P&gt;
&lt;P&gt;B1,B3&lt;/P&gt;
&lt;P&gt;C1,C2&lt;/P&gt;
&lt;P&gt;D1,D2&lt;/P&gt;
&lt;P&gt;C2,C3&lt;/P&gt;
&lt;P&gt;D2,D3&lt;/P&gt;
&lt;P&gt;D3,D4&lt;/P&gt;
&lt;P&gt;D4,D5&lt;/P&gt;
&lt;P&gt;D4,D6&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;left join (input)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;values:&lt;/P&gt;
&lt;P&gt;load * inline [&lt;/P&gt;
&lt;P&gt;Leaf, Value&lt;/P&gt;
&lt;P&gt;A1, 10&lt;/P&gt;
&lt;P&gt;B1, 20&lt;/P&gt;
&lt;P&gt;C1, 30&lt;/P&gt;
&lt;P&gt;D1, 40&lt;/P&gt;
&lt;P&gt;B2, 50&lt;/P&gt;
&lt;P&gt;C2, 60&lt;/P&gt;
&lt;P&gt;D2, 70&lt;/P&gt;
&lt;P&gt;C3, 80&lt;/P&gt;
&lt;P&gt;D3, 90&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//cheat using the hierarchy belongs to to sus out our layers&lt;/P&gt;
&lt;P&gt;HierarchyBelongsTo:&lt;/P&gt;
&lt;P&gt;HierarchyBelongsTo (Node, Parent, NodeName, AncestorID, AncestorName, DepthDiff)&lt;/P&gt;
&lt;P&gt;Load &lt;/P&gt;
&lt;P&gt;&amp;nbsp; Leaf as Node ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Leaf as NodeName,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Stem as Parent&lt;/P&gt;
&lt;P&gt;resident input;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//create a layers table to we can figure out which layer we want to load &lt;/P&gt;
&lt;P&gt;LEFT JOIN (input)&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT Node as Leaf, max(DepthDiff)+1 as MaxDepth &lt;/P&gt;
&lt;P&gt;Resident HierarchyBelongsTo&lt;/P&gt;
&lt;P&gt;GROUP BY Node;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//figure out our max depth we need to work to&lt;/P&gt;
&lt;P&gt;MaxLayers:&lt;/P&gt;
&lt;P&gt;LOAD max(MaxDepth) as MaxLayers&lt;/P&gt;
&lt;P&gt;resident input;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LET vLayers = peek('MaxLayers');&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//drop working table&lt;/P&gt;
&lt;P&gt;DROP TABLE MaxLayers;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//LOAD our top layer which won't have a record in the layers table&lt;/P&gt;
&lt;P&gt;HierarchyMain:&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT Stem as Layer0 &lt;/P&gt;
&lt;P&gt;resident input&lt;/P&gt;
&lt;P&gt;WHERE NOT EXISTS (Node,Stem);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//now run our loop&lt;/P&gt;
&lt;P&gt;for i=1 to $(vLayers)&lt;/P&gt;
&lt;P&gt;let x = $(i)-1;&lt;/P&gt;
&lt;P&gt;LEFT JOIN (HierarchyMain) &lt;/P&gt;
&lt;P&gt;LOAD Stem as 'Layer$(x)',Leaf as 'Layer$(i)', Value as 'Value$(i)'&lt;/P&gt;
&lt;P&gt;resident input&lt;/P&gt;
&lt;P&gt;WHERE MaxDepth = $(i) ;&lt;/P&gt;
&lt;P&gt;next i;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;//drop working table&lt;/P&gt;
&lt;P&gt;DROP TABLE HierarchyBelongsTo;&lt;/P&gt;
&lt;P&gt;DROP TABLE input;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 09:37:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230772#M392226</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T09:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230773#M392227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adam,&lt;/P&gt;&lt;P&gt;It is possible to load all values i.e Value1, Value2...... on single field like &lt;STRONG&gt;Value&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 09:47:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230773#M392227</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2017-01-03T09:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230774#M392228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't quite understand, do you mean the SUM of all values? so a single total value for the row?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 09:58:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230774#M392228</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T09:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230775#M392229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Segoe UI',sans-serif; color: black;"&gt;we want to get the coresponding value for all the layers as in &lt;STRONG style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;Data &lt;/STRONG&gt;&lt;STRONG&gt;table&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 2.0pt; margin-bottom: 2.0pt;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: 'Segoe UI',sans-serif; color: black;"&gt;in a single column&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 10:14:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230775#M392229</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2017-01-03T10:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230776#M392230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK so in your example for your row C value = 170?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 10:18:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230776#M392230</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T10:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230777#M392231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when we click on&amp;nbsp; C value = 80 not 170.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 10:50:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230777#M392231</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2017-01-03T10:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230778#M392232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok so the value column should show the value for the lowest leaf in the row?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 10:53:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230778#M392232</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T10:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230779#M392233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 11:07:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230779#M392233</guid>
      <dc:creator>ahmar811</dc:creator>
      <dc:date>2017-01-03T11:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Executing of values till leaf node.</title>
      <link>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230780#M392234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I will have a think when I get a moment, it must be pretty easy to do as you just add a column called 'lowestleaf' and join that to the value table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jan 2017 11:43:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Executing-of-values-till-leaf-node/m-p/1230780#M392234</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-03T11:43:21Z</dc:date>
    </item>
  </channel>
</rss>

