<?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: Average values by distinct date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630332#M1091104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(cases) / count({&amp;lt;cases = {"*"}&amp;gt;} distinct date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 May 2014 22:59:22 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2014-05-12T22:59:22Z</dc:date>
    <item>
      <title>Average values by distinct date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630330#M1091102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example of my data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 192px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" width="64"&gt;date&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;cases&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="64"&gt;type&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/26/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/25/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;92&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/25/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/25/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;162&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/24/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;92&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/24/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;3&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/23/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;92&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/23/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/22/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;92&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/22/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/22/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;162&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/21/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;92&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/21/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/21/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;97&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/21/2014&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;0&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;162&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/20/2014&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;92&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/20/2014&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/20/2014&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;97&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="20" style="border-top: none;" width="64"&gt;4/20/2014&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;" width="64"&gt;162&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to average the "cases" per day, regardless of "type".&amp;nbsp; So, this would be an average of 1.2 (=6/5), since there were 2 on 4/24/2014, 4 on 4/24/2014, and 0 on 4/23/2014, 4/22/2014, and 4/21/2014.&amp;nbsp; My average would not include 4/20/2014 or 4/26/2014 since the value for "cases" has a null on those days.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried avg(cases), but that gives me 0.375 (=6/16).&amp;nbsp; It's counting all the numbers in the "cases" column as an instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried avg({&amp;lt;cases = {'&amp;lt;&amp;gt;0'}&amp;gt;} cases), but that gives me 1.5 (=6/4).&amp;nbsp; It's counting all the non-zero numbers in the "cases" column as an instance, but I want it to count just the ones with distinct dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried avg(distinct {&amp;lt;cases = {'&amp;lt;&amp;gt;0'}&amp;gt;} cases), but that gives me 1.5 (=2/2).&amp;nbsp; It's only taking '3' and '1' as the two instances to average.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried aggr, but I can't get that to even give me a number.&amp;nbsp; I think I'm using it wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 22:41:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630330#M1091102</guid>
      <dc:creator />
      <dc:date>2014-05-12T22:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Average values by distinct date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630331#M1091103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In case it matters, I want to aggregate this number to use it in a text box, not a chart or anything like that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 22:44:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630331#M1091103</guid>
      <dc:creator />
      <dc:date>2014-05-12T22:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Average values by distinct date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630332#M1091104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(cases) / count({&amp;lt;cases = {"*"}&amp;gt;} distinct date)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 22:59:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630332#M1091104</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2014-05-12T22:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Average values by distinct date</title>
      <link>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630333#M1091105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 23:04:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-values-by-distinct-date/m-p/630333#M1091105</guid>
      <dc:creator />
      <dc:date>2014-05-12T23:04:22Z</dc:date>
    </item>
  </channel>
</rss>

