<?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: Aggregating data based on hierarchical levels in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggregating-data-based-on-hierarchical-levels/m-p/839543#M295090</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Perhaps this discussion helps: &lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="188451" data-objecttype="2" href="https://community.qlik.com/message/188451#188451" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7;"&gt;Re: BOM Explosion using Hierarchy &amp;amp; HierarchyBelongsTo&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 May 2015 07:54:27 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2015-05-12T07:54:27Z</dc:date>
    <item>
      <title>Aggregating data based on hierarchical levels</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-data-based-on-hierarchical-levels/m-p/839542#M295089</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;I was wondering if there was a way to sum up values or count values using a hierarchy. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a hierarchy structure in my source data with the following structure: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Level1 &amp;gt; Level2&amp;gt; Level3&amp;gt; &lt;/P&gt;&lt;P&gt;Each level will have a set of children associated with it. So : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Level1&lt;/P&gt;&lt;P&gt;&amp;gt; L1Child1&lt;/P&gt;&lt;P&gt;&amp;gt; L1Child2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Level2&lt;/P&gt;&lt;P&gt;&amp;gt;L2Child1&lt;/P&gt;&lt;P&gt;&amp;gt;L2Child2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Level3&lt;/P&gt;&lt;P&gt;&amp;gt;L3Child1&lt;/P&gt;&lt;P&gt;&amp;gt;L3Child2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The branches in the hierarchy tree expand even further where the children branches will have their own branches. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Level1 &lt;/P&gt;&lt;P&gt;&amp;gt;L1Child1&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;L1SubChild1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have transactional data with sales data where each record has a SaleID with a Salesperson. Each Salesperson belongs to a specific level in the hierarchy. When a Salesperson moves up or down the hierarchy, his sales move with him. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my sales data looks like: &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;&lt;STRONG&gt;SaleID&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;Sales Date&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;SalespersonID&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;0001&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12/05/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;0002&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;12/05/2015&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The hierarchy lookup table looks something like: &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;Hierarchy Level&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Parent&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;Child&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Level1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NULL&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;L1Child1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Level1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;NULL&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;L1Child2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Level2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Level1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;L2Child1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Level2&lt;/TD&gt;&lt;TD&gt;Level1&lt;/TD&gt;&lt;TD&gt;L2Child2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;L1Child1&lt;/TD&gt;&lt;TD&gt;Level1&lt;/TD&gt;&lt;TD&gt;L1Subchild1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The mapping of the salesperson to their respective level looks like this: &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;SalespersonID&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Level&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;Level1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Level2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the above structures and tables, a direct link between a Salesperson can be done. So when we want to find a count of the number of sales based on the hierarchy level this counts the number of sales for only that level. When Level1 is selected only 1 sale will be counted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to count the number of sales for the direct hierarchy level along with the children underneath. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of sales for Level 1 should include all sales from Level1 up until the subchild of Level3 when selected in the dashboard. When a user selects Level2 all of the sales for the children and subchildren need to be counted EXCLUDING Level1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above sales tables shows 2 sales for salesperson 1 and 2. When I select Level1 this should calculate 2 sales and and 1 sale. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I select Level2, this should show only 1 sale. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can this be done? Are there any good solutions for this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 06:46:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-data-based-on-hierarchical-levels/m-p/839542#M295089</guid>
      <dc:creator />
      <dc:date>2015-05-12T06:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregating data based on hierarchical levels</title>
      <link>https://community.qlik.com/t5/QlikView/Aggregating-data-based-on-hierarchical-levels/m-p/839543#M295090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Perhaps this discussion helps: &lt;/SPAN&gt;&lt;A _jive_internal="true" data-containerid="2051" data-containertype="14" data-objectid="188451" data-objecttype="2" href="https://community.qlik.com/message/188451#188451" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3778c7;"&gt;Re: BOM Explosion using Hierarchy &amp;amp; HierarchyBelongsTo&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 May 2015 07:54:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggregating-data-based-on-hierarchical-levels/m-p/839543#M295090</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-05-12T07:54:27Z</dc:date>
    </item>
  </channel>
</rss>

