<?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 How to use aggregation functions on a TreeView hierarchy in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-aggregation-functions-on-a-TreeView-hierarchy/m-p/363677#M1174978</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My database has a table of parts that can be composed of other parts. They each have a &lt;STRONG&gt;Price &lt;/STRONG&gt;field.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;Part &lt;/STRONG&gt;table also has a &lt;STRONG&gt;Parent_Part&lt;/STRONG&gt; field to represent an adjacent nodes tables (The parts hierarchy).&lt;/P&gt;&lt;P&gt;In the Load Script I use the &lt;EM&gt;hierarchy &lt;/EM&gt;function to obtain the &lt;SPAN class="Bold"&gt;PathName of each Part &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt; &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;I can then visualise the hierarchy in a TreeView ListBox. (which is awesome by the way)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;I tried to calulate the total cost of a &lt;STRONG&gt;Part &lt;/STRONG&gt;(the sum of the cost of the sub parts) by adding the caculated expression : &lt;EM&gt;SUM(Price)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;but I only get the the cost of one part.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;How do you calculate the &lt;/SPAN&gt;total cost of a Part?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 May 2012 14:57:26 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-22T14:57:26Z</dc:date>
    <item>
      <title>How to use aggregation functions on a TreeView hierarchy</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-aggregation-functions-on-a-TreeView-hierarchy/m-p/363677#M1174978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My database has a table of parts that can be composed of other parts. They each have a &lt;STRONG&gt;Price &lt;/STRONG&gt;field.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;Part &lt;/STRONG&gt;table also has a &lt;STRONG&gt;Parent_Part&lt;/STRONG&gt; field to represent an adjacent nodes tables (The parts hierarchy).&lt;/P&gt;&lt;P&gt;In the Load Script I use the &lt;EM&gt;hierarchy &lt;/EM&gt;function to obtain the &lt;SPAN class="Bold"&gt;PathName of each Part &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt; &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;I can then visualise the hierarchy in a TreeView ListBox. (which is awesome by the way)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;I tried to calulate the total cost of a &lt;STRONG&gt;Part &lt;/STRONG&gt;(the sum of the cost of the sub parts) by adding the caculated expression : &lt;EM&gt;SUM(Price)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;but I only get the the cost of one part.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;How do you calculate the &lt;/SPAN&gt;total cost of a Part?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Nick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 14:57:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-aggregation-functions-on-a-TreeView-hierarchy/m-p/363677#M1174978</guid>
      <dc:creator />
      <dc:date>2012-05-22T14:57:26Z</dc:date>
    </item>
    <item>
      <title>How to use aggregation functions on a TreeView hierarchy</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-aggregation-functions-on-a-TreeView-hierarchy/m-p/363678#M1174979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems the expression in a TreeView does not behave the same as in charts.&lt;BR /&gt;I solved the problem of getting the recursive sum of all the subparts by adding a text Object with the same expression.&lt;/P&gt;&lt;P&gt;Since clicking on a contracted node of a treeView also selects all the sub nodes, the text object displays the total price of the part!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 18:29:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-aggregation-functions-on-a-TreeView-hierarchy/m-p/363678#M1174979</guid>
      <dc:creator />
      <dc:date>2012-06-08T18:29:43Z</dc:date>
    </item>
  </channel>
</rss>

