<?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: Avg expression differs from Excel in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219190#M390086</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed without distinct it worked in my test dashboard but not in my full dashboard.&lt;/P&gt;&lt;P&gt;These 2 test record where causing the issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:test@test.nl"&gt;test@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-29&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rating is the same for 2 email addresses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore this formula did work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Avg(Aggr(Sum(distinct {&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating),Submission_Date,Rating))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;However that also didn't work anymore when the submission date and the rating was the same, for example for these 2 records:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:test@test.nl"&gt;test@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore i replaced the submission date with the email address like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Avg(Aggr(Sum(distinct {&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating),EmailAddress,Rating))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This formula seems to work now. I'm only trying to understand why it did work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;What is the purpose of the value before rating? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Feb 2017 16:06:48 GMT</pubDate>
    <dc:creator>twanqlik</dc:creator>
    <dc:date>2017-02-06T16:06:48Z</dc:date>
    <item>
      <title>Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219183#M390079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a very simple AVG expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg(distinct{&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should calculate the AVG Rating over all the records that match the EmailTypeSent and Moderation Status. However, i'n my attached .qvw Qlikview shows me an average of 2.75, while it should be 2.6 according to Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="362"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="94"&gt;EmailAddress&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="42"&gt;Rating&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="119"&gt;Moderation_Status&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="107"&gt;Submission_Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;APPROVED&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2016-06-29&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;APPROVED&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2016-06-29&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;APPROVED&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2016-06-29&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;&lt;A class="jive-link-email-small" href="mailto:test@test.nl"&gt;test@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;APPROVED&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt;&lt;A class="jive-link-email-small" href="mailto:test@test.nl"&gt;test@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;5&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;APPROVED&lt;/TD&gt;&lt;TD class="xl64" style="border-top: none; border-left: none;"&gt;2016-06-29&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The average of 1, 2, 3, 2 and 5 = 2.6&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=AVG(Rating) works in my attached QVW, but will not work in my dashboard because it misses a few criteria.&lt;/P&gt;&lt;P&gt;What did I miss here? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 11:58:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219183#M390079</guid>
      <dc:creator>twanqlik</dc:creator>
      <dc:date>2017-02-06T11:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219184#M390080</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;Use like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;avg&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;EmailTypeSent&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'Rate&amp;amp;Review'},&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Moderation_Status&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;={'APPROVED'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Rating&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; -----&amp;gt;&amp;gt; it ll give u 2.6&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Why you are using Distinct over there,any reason(I don't&amp;nbsp; think so)??&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:11:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219184#M390080</guid>
      <dc:creator>sdmech81</dc:creator>
      <dc:date>2017-02-06T12:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219185#M390081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Avg(Aggr(Sum(distinct {&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating),Submission_Date,Rating))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:13:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219185#M390081</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2017-02-06T12:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219186#M390082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;He might be using it because the data has duplicate values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:14:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219186#M390082</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2017-02-06T12:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219187#M390083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3208"&gt;Average – Which average?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:16:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219187#M390083</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2017-02-06T12:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219188#M390084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Sachin.... without distinct seems to be working&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Avg({&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;} Rating)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/152153_Capture.PNG" style="height: 237px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:18:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219188#M390084</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-02-06T12:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219189#M390085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just removing the distinct keyword also works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg({&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can also use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating)/&lt;/P&gt;&lt;P&gt;count({&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:18:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219189#M390085</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2017-02-06T12:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Avg expression differs from Excel</title>
      <link>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219190#M390086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed without distinct it worked in my test dashboard but not in my full dashboard.&lt;/P&gt;&lt;P&gt;These 2 test record where causing the issue:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:test@test.nl"&gt;test@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-29&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The rating is the same for 2 email addresses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore this formula did work:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Avg(Aggr(Sum(distinct {&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating),Submission_Date,Rating))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;However that also didn't work anymore when the submission date and the rating was the same, for example for these 2 records:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:test@test.nl"&gt;test@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A class="jive-link-email-small" href="mailto:hop@test.nl"&gt;hop@test.nl&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;APPROVED&lt;/TD&gt;&lt;TD&gt;2016-06-30&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Therefore i replaced the submission date with the email address like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Avg(Aggr(Sum(distinct {&amp;lt;EmailTypeSent*={'*Rate&amp;amp;Review*'},Moderation_Status*={'APPROVED'}&amp;gt;}Rating),EmailAddress,Rating))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This formula seems to work now. I'm only trying to understand why it did work &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;What is the purpose of the value before rating? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Feb 2017 16:06:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avg-expression-differs-from-Excel/m-p/1219190#M390086</guid>
      <dc:creator>twanqlik</dc:creator>
      <dc:date>2017-02-06T16:06:48Z</dc:date>
    </item>
  </channel>
</rss>

