<?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: Agrr Calculation in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Agrr-Calculation/m-p/1926577#M76302</link>
    <description>&lt;P&gt;It is returning the correct output given your data&lt;/P&gt;
&lt;P&gt;there are two possible values in level 3&lt;/P&gt;
&lt;P&gt;1) Area1&lt;/P&gt;
&lt;P&gt;2)'-'&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only want to calculate level3 where field is not '-' or null then change expression to below,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level3)&amp;gt;1"}&amp;gt;}Hours)&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;&amp;lt;-- returns sum hours at level3 where level3 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Also since level3 is your last level, you don't need sum(Aggr(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any other Level which is not the last level you can be calculated using the TOTAL keyword as below&lt;/P&gt;
&lt;P&gt;&lt;U&gt;For level2&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level3)&amp;gt;1"}&amp;gt;} TOTAL &amp;lt;Level2&amp;gt; Hours)&lt;/STRONG&gt;&amp;nbsp;&amp;lt;&amp;lt;-- returns sum hours at level2 where level3 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;for Level1&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level3)&amp;gt;1"}&amp;gt;} TOTAL &amp;lt;Level1&amp;gt; Hours)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;&amp;lt;-- returns sum hours at level1 where level3 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if you need to check if the corresponding level is not empty then change the set analysis&amp;nbsp; as below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level2)&amp;gt;1"}&amp;gt;} TOTAL &amp;lt;Level2&amp;gt; Hours)&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&amp;lt;-- returns sum hours where level2 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2022 04:02:35 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2022-05-05T04:02:35Z</dc:date>
    <item>
      <title>Agrr Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Agrr-Calculation/m-p/1926236#M76260</link>
      <description>&lt;P&gt;Dear Gurus,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an scenario where one record (Node_ID) can have different Levels of Hierarchy. Then we have a KPI of Number of Hours for each one. In the example below, I want to calculate the number of Hours only in Level 3. For that I use an Aggr as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sum(Aggr(Sum([Hours]),[Level 3])&lt;/P&gt;
&lt;P&gt;But it's summing the TOTAL of Hours (as if I was calculating the Total for Level 2:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jorditorras_0-1651664733490.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/78631iE37B72025607B784/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jorditorras_0-1651664733490.png" alt="jorditorras_0-1651664733490.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The result that I expect is 45.837 and not 190.207...&lt;/P&gt;
&lt;P&gt;Any idea how to calculate this??&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 13:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Agrr-Calculation/m-p/1926236#M76260</guid>
      <dc:creator>jorditorras</dc:creator>
      <dc:date>2022-05-04T13:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Agrr Calculation</title>
      <link>https://community.qlik.com/t5/App-Development/Agrr-Calculation/m-p/1926577#M76302</link>
      <description>&lt;P&gt;It is returning the correct output given your data&lt;/P&gt;
&lt;P&gt;there are two possible values in level 3&lt;/P&gt;
&lt;P&gt;1) Area1&lt;/P&gt;
&lt;P&gt;2)'-'&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you only want to calculate level3 where field is not '-' or null then change expression to below,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level3)&amp;gt;1"}&amp;gt;}Hours)&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;&amp;lt;&amp;lt;-- returns sum hours at level3 where level3 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Also since level3 is your last level, you don't need sum(Aggr(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any other Level which is not the last level you can be calculated using the TOTAL keyword as below&lt;/P&gt;
&lt;P&gt;&lt;U&gt;For level2&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level3)&amp;gt;1"}&amp;gt;} TOTAL &amp;lt;Level2&amp;gt; Hours)&lt;/STRONG&gt;&amp;nbsp;&amp;lt;&amp;lt;-- returns sum hours at level2 where level3 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;for Level1&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level3)&amp;gt;1"}&amp;gt;} TOTAL &amp;lt;Level1&amp;gt; Hours)&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;&amp;lt;-- returns sum hours at level1 where level3 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if you need to check if the corresponding level is not empty then change the set analysis&amp;nbsp; as below&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;sum({&amp;lt;Nodes_Id={"=len(Level2)&amp;gt;1"}&amp;gt;} TOTAL &amp;lt;Level2&amp;gt; Hours)&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&amp;lt;&amp;lt;-- returns sum hours where level2 is not empty&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 04:02:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Agrr-Calculation/m-p/1926577#M76302</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-05-05T04:02:35Z</dc:date>
    </item>
  </channel>
</rss>

