<?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: Aggr count null instead 0 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936258#M980950</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;Got it!&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: 12px;"&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: 12px;"&gt;=&lt;STRONG&gt;SUM&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;aggr(count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DISTINCT DOC_NO), DATE))&lt;STRONG&gt;/COUNT(DISTINCT DATE)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;tahnks for your time&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2015 13:19:44 GMT</pubDate>
    <dc:creator>arsenal1983</dc:creator>
    <dc:date>2015-08-17T13:19:44Z</dc:date>
    <item>
      <title>Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936251#M980935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;QV Masters,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with aggr function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to count the average daily number of invoices that meets several conditions. I have used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=avg(&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;aggr(count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;DISTINCT DOC_NO), DATE))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the problem is that when &lt;SPAN style="font-size: 10pt;"&gt;count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;DISTINCT DOC_NO) = 0 then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;aggr(count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;DISTINCT DOC_NO), DATE) is NULL and such days are not taken to the average.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 10:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936251#M980935</guid>
      <dc:creator>arsenal1983</dc:creator>
      <dc:date>2015-08-17T10:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936252#M980937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See if this helps:&lt;/P&gt;&lt;P&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;STRONG&gt;=RangeAvg(A&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #3d3d3d; font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;ggr(Count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;DISTINCT DOC_NO), DATE))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 10:46:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936252#M980937</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-17T10:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936253#M980940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;ALT(YourExpression,0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 10:53:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936253#M980940</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-08-17T10:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936254#M980942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish do you think this will work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;=Avg(Alt(A&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;ggr(Count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333320617676px; font-family: inherit;"&gt;DISTINCT DOC_NO), DATE), 0))&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 10:56:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936254#M980942</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-08-17T10:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936255#M980944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This will give 0 if expression result is null...&lt;/P&gt;&lt;P&gt;Bcoz Avg(0) = 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 10:58:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936255#M980944</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2015-08-17T10:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936256#M980946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about the good old&lt;/P&gt;&lt;P&gt;count({...} distinct DOC_NO) / count (distinct DATE)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 11:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936256#M980946</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-17T11:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936257#M980948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sending my data model, and problem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 tables:&lt;/P&gt;&lt;P&gt;1. LINES - with DOC deatails, the most important are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;DOKUMENT_KLUCZ - which is DOC_ID&lt;/LI&gt;&lt;LI&gt;CPUDT - which is the date the DOC was created into the system&lt;/LI&gt;&lt;LI&gt;AUGDT - which is the date the DOC was processed, it can be null if the DOC is still open item&lt;/LI&gt;&lt;LI&gt;REF_DATE_KEY - which is CPUDT+"\"+AUGDT&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;2. REF DATE - indirect table that contain:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;REF&lt;SPAN style="font-size: 13.3333330154419px;"&gt;_DATE_KEY - from LINES table&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;REF_DATE_MOD - the dates when the doc was open&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;DIFF between &lt;SPAN style="font-size: 13.3333330154419px;"&gt;CPUDT and &lt;SPAN style="font-size: 13.3333330154419px;"&gt;REF_DATE_MOD&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;3. The third table is just dictionaty for REF_DATE_MOD&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 12:32:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936257#M980948</guid>
      <dc:creator>arsenal1983</dc:creator>
      <dc:date>2015-08-17T12:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936258#M980950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;Got it!&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: 12px;"&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: 12px;"&gt;=&lt;STRONG&gt;SUM&lt;/STRONG&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;aggr(count({$&amp;lt;CON1= {'1'}, CON2 = {'2'}, CON3 = {'3'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;DISTINCT DOC_NO), DATE))&lt;STRONG&gt;/COUNT(DISTINCT DATE)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;tahnks for your time&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 13:19:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936258#M980950</guid>
      <dc:creator>arsenal1983</dc:creator>
      <dc:date>2015-08-17T13:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr count null instead 0</title>
      <link>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936259#M980952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad it works, but my simple suggestion above returns the same result:&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;REF_DATE_DATE_NULL_FLAG = {'0'}, REF_DATE_DIFF = {"&amp;gt;=$(v0000100093)"}&amp;gt;} DISTINCT REF_DATE_DATE_MOD)/COUNT(DISTINCT REF_DATE_DATE_MOD)&lt;/P&gt;&lt;P&gt;No sum(aggr()) needed&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 10:34:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggr-count-null-instead-0/m-p/936259#M980952</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-18T10:34:06Z</dc:date>
    </item>
  </channel>
</rss>

