<?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: Problem Avg and AGGR in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483663#M180737</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;1st Use sets.&lt;/P&gt;&lt;P&gt;2nd Avg does not work fine with null values.&lt;/P&gt;&lt;P&gt;3rd Do the avg first and enclose it on aggr. If your aggr is for a table and you see only one value go like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr( NODISTINCT avg (expression) , DIM1, DIM2, DIM3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4th then add your if like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( aggr( NODISTINCT avg (expression) , DIM1, DIM2, DIM3) &amp;gt; 100, 100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr( NODISTINCT avg (expression) , DIM1, DIM2, DIM3))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2013 11:23:51 GMT</pubDate>
    <dc:creator>christian77</dc:creator>
    <dc:date>2013-10-17T11:23:51Z</dc:date>
    <item>
      <title>Problem Avg and AGGR</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483661#M180735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, I have a big problem to use of AVG + AGGR, I'm trying to make an average between these two values​​, for example:&lt;/P&gt;&lt;P&gt;90.3 and 136.4, but for me values ​​&amp;gt; 100 are 100&lt;/P&gt;&lt;P&gt;my formula is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AVG(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGGR/count(A)\count(B), D1,D2,D3)&amp;gt;100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100, AVG(AGGR/count(A)\count(B), D1,D2,D3)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the result is 100&amp;nbsp; that (in reality it would be 113.35) avg between (90.3 and 136.4)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my correct result would be 95.15 avg (90.3 and 100)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any solution about?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 11:11:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483661#M180735</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-17T11:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Avg and AGGR</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483662#M180736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't really understand your expression, what does this mean: AGGR/count(A)\count(B), D1,D2,D3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In principle, something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg( if( FIELD &amp;gt; 100,100,FIELD ))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;shall work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if you need advanced aggregation, maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg( aggr( if(FIELD &amp;gt; 100,100,FIELD), DIM1, DIM2, DIM3))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 11:17:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483662#M180736</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-10-17T11:17:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Avg and AGGR</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483663#M180737</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;1st Use sets.&lt;/P&gt;&lt;P&gt;2nd Avg does not work fine with null values.&lt;/P&gt;&lt;P&gt;3rd Do the avg first and enclose it on aggr. If your aggr is for a table and you see only one value go like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr( NODISTINCT avg (expression) , DIM1, DIM2, DIM3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4th then add your if like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( aggr( NODISTINCT avg (expression) , DIM1, DIM2, DIM3) &amp;gt; 100, 100,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr( NODISTINCT avg (expression) , DIM1, DIM2, DIM3))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 11:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483663#M180737</guid>
      <dc:creator>christian77</dc:creator>
      <dc:date>2013-10-17T11:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem Avg and AGGR</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483664#M180738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I use this advanced aggregation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF(AVG(AGGR(count(A)\count(B), D1,D2,D3)&amp;gt;100, 100, AVG(AGGR/count(A)\count(B), D1,D2,D3))) &lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;but when the value of the currency if &amp;gt; 100 does not do it for single value but rather for the total for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two values&lt;/P&gt;&lt;P&gt;90.3 and 136 the expression result is 113.15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I expect that the expression of the average&lt;/P&gt;&lt;P&gt;90.3 and 100&amp;nbsp; the result is 95.15&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2013 14:13:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-Avg-and-AGGR/m-p/483664#M180738</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-17T14:13:46Z</dc:date>
    </item>
  </channel>
</rss>

