<?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 Question about aggregation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Question-about-aggregation/m-p/1358841#M416719</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a chart with two dimensions, Item Number and Batch Number. It also has 3 expressions: sum(WI_TotalUnits), sum([Physical stock]), and the 3rd expression is a conditional statement intended to count the number of lines on which there is no variance between WI_TotalUnits and Physical stock, like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (sum([Physical stock]) - sum(WI_TotalUnits) &amp;lt;&amp;gt; 0,0,1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then use the Avg function (instead of Expression Default) to convert to the percentage of rows that have no variance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However my problem comes in when I want to do the same percentage calculation in a TEXT BOX, rather than in the totals row of my chart. I need to place the entire logic into an independent text box to get the same percentile result. I have been looking at the AGGR() function but this is giving me the wrong answer. This is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sum(WI_TotalUnits - [Physical stock]) &amp;lt;&amp;gt; 0,0,1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[Item number], [Batch number]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This aggregate gives a percentage result that is different to the one in the original chart. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Aug 2017 06:48:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-08-07T06:48:37Z</dc:date>
    <item>
      <title>Question about aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Question-about-aggregation/m-p/1358841#M416719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a chart with two dimensions, Item Number and Batch Number. It also has 3 expressions: sum(WI_TotalUnits), sum([Physical stock]), and the 3rd expression is a conditional statement intended to count the number of lines on which there is no variance between WI_TotalUnits and Physical stock, like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (sum([Physical stock]) - sum(WI_TotalUnits) &amp;lt;&amp;gt; 0,0,1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then use the Avg function (instead of Expression Default) to convert to the percentage of rows that have no variance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However my problem comes in when I want to do the same percentage calculation in a TEXT BOX, rather than in the totals row of my chart. I need to place the entire logic into an independent text box to get the same percentile result. I have been looking at the AGGR() function but this is giving me the wrong answer. This is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sum(WI_TotalUnits - [Physical stock]) &amp;lt;&amp;gt; 0,0,1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[Item number], [Batch number]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This aggregate gives a percentage result that is different to the one in the original chart. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Aug 2017 06:48:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-about-aggregation/m-p/1358841#M416719</guid>
      <dc:creator />
      <dc:date>2017-08-07T06:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Question about aggregation</title>
      <link>https://community.qlik.com/t5/QlikView/Question-about-aggregation/m-p/1358842#M416720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not to worry I think I've sorted this out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Aug 2017 09:33:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Question-about-aggregation/m-p/1358842#M416720</guid>
      <dc:creator />
      <dc:date>2017-08-07T09:33:40Z</dc:date>
    </item>
  </channel>
</rss>

