<?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 Count() behaving as count(distinct)?? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312158#M407724</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&amp;nbsp; I'm not a regular Qlikview user, so tend to stick to fairly simple functionality.&amp;nbsp; I am trying to compare 2 very similar data sets and finding the behavior of Count() to be different (one shown on AccessPoint,(QlikviewV11) and one on my Personal Edition (V12) - although I wouldn't have thought that would make a difference...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Personal Edition seems to be treating a count() as a count(distinct) - as you can see here it returns a count of 1 when there are plainly multiple records that match:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/161123_pastedImage_3.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;For comparison, the version on AccessPoint gives what I would expect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/161124_pastedImage_4.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;I can't find anything on the community/help to explain this, can anyone help please? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Apr 2017 09:23:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-04-25T09:23:24Z</dc:date>
    <item>
      <title>Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312158#M407724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&amp;nbsp; I'm not a regular Qlikview user, so tend to stick to fairly simple functionality.&amp;nbsp; I am trying to compare 2 very similar data sets and finding the behavior of Count() to be different (one shown on AccessPoint,(QlikviewV11) and one on my Personal Edition (V12) - although I wouldn't have thought that would make a difference...).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Personal Edition seems to be treating a count() as a count(distinct) - as you can see here it returns a count of 1 when there are plainly multiple records that match:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/161123_pastedImage_3.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;For comparison, the version on AccessPoint gives what I would expect:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/161124_pastedImage_4.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;I can't find anything on the community/help to explain this, can anyone help please? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:23:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312158#M407724</guid>
      <dc:creator />
      <dc:date>2017-04-25T09:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312159#M407725</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;Is it possible to share the application here?This will help to solve the issue in a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mayank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:29:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312159#M407725</guid>
      <dc:creator>mayankraoka</dc:creator>
      <dc:date>2017-04-25T09:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312160#M407726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this field a key field in your model? (you shouldn't count a key field without distinct qualifier)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And are you looking at the exact same data set, no reload performed inbetween? No section access involved?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:34:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312160#M407726</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-04-25T09:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312161#M407727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your input.&amp;nbsp; I haven't specified it as a key (not sure how I'd do that), and it's not a link to another table, but the Internal Table View shows "[Perfect Key]" after the field name in the owning table.&amp;nbsp; I presume this is determined by Qlikview automatically when the data is loaded..? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to count the number of records for each value of this field - surely that should be achievable?&amp;nbsp; I always want to count the number of records with a distinct feature.&amp;nbsp; I've been using count() in this way for years without coming across this before...?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, it's not exactly the same data set - that's why I was doing the comparison.&amp;nbsp; I'm afraid I don't know what 'section access' refers to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:52:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312161#M407727</guid>
      <dc:creator />
      <dc:date>2017-04-25T09:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312162#M407728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Mayank - the data is confidential.&amp;nbsp; If this isn't as simple to resolve as I hope, I'll have to try to replicate it with some sanitized data.&amp;nbsp; Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 09:54:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312162#M407728</guid>
      <dc:creator />
      <dc:date>2017-04-25T09:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312163#M407729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Stefan, my last answer wasn't correct - it is a link to another table, here's the table view.&amp;nbsp; I still want to count the number of plan objects with this feature though. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/161133_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 10:06:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312163#M407729</guid>
      <dc:creator />
      <dc:date>2017-04-25T10:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312164#M407730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to count another field, that shows a value (i.e. it is not NULL) for each record where protectionplancodeplusrevision shows a value. Any field in table plan without any NULL will do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count(plan_id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason why you get different results is that Qlik can't really count records for a key field, it's not specified in which table you want to count records. You will get a result, but it can be anything from 'expected' to 'totally off'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 10:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312164#M407730</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-04-25T10:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312165#M407731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That makes perfect sense.&amp;nbsp; Thanks Stefan!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 10:50:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312165#M407731</guid>
      <dc:creator />
      <dc:date>2017-04-25T10:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312166#M407732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've just noticed that plan_id is also a key field. Same issue will apply to plan_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Need to correct above to&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #edf8ca;"&gt;Any &lt;EM&gt;&lt;STRONG&gt;non-key&lt;/STRONG&gt;&lt;/EM&gt; field in table plan without any NULL will do.&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; background-color: #edf8ca;"&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; background-color: #edf8ca;"&gt;Maybe plan_processdate (if there are no NULL), or create a new field in that table LOAD in your script, with a constant 1 per record (then you can also Sum(CountField) it).&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 10:57:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312166#M407732</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-04-25T10:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312167#M407733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a shame Stefan, I was hoping that wouldn't be the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this is a problem with being a 'light' Qlikview user - I'd never have guessed I needed to do that to perform a count!&amp;nbsp; From an SQL perspective the whole point of a primary key is that it's the &lt;STRONG&gt;one&lt;/STRONG&gt; field you know is not NULL...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd have thought this would be a common issue and there'd be a way to specify counting the key field instances from a specific table rather than having to create a special per-row counter/flag...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 11:21:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312167#M407733</guid>
      <dc:creator />
      <dc:date>2017-04-25T11:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312168#M407734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;PS: Just temporarily unmarked your answer as correct (no offence intended!) so I'm not discouraging any alternative solutions from being offered..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 11:27:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312168#M407734</guid>
      <dc:creator />
      <dc:date>2017-04-25T11:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count() behaving as count(distinct)??</title>
      <link>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312169#M407735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan.&amp;nbsp; Any chance you can take a look at where this issue went from our original discussion?&amp;nbsp; I branched thread &lt;SPAN style="mso-bidi-font-family: 'Times New Roman'; mso-fareast-language: EN-US; mso-bidi-language: AR-SA; line-height: 115%; color: #000000; font-size: 11pt; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-GB; font-family: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-fareast-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-bidi-theme-font: minor-bidi;"&gt;1261988&lt;/SPAN&gt; as the counter solution seemed to give inconsistent results and no-one seems to be able to shed any light on what looks to me to be a straightforward issue.&amp;nbsp; Any help would be much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2017 09:22:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-behaving-as-count-distinct/m-p/1312169#M407735</guid>
      <dc:creator />
      <dc:date>2017-05-05T09:22:08Z</dc:date>
    </item>
  </channel>
</rss>

