<?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(distinct(id)) vs sum(countValue) - Current Best Practice? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-distinct-id-vs-sum-countValue-Current-Best-Practice/m-p/1072983#M358227</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have always been of the mind that I should use sum(countValue) when building count(id) type logic, with the [countValue] having been added in the model script to facilitate this as a 1 where it should be counted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know there are two good reasons for doing this -&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;sum([&lt;EM&gt;a column full of 1s&lt;/EM&gt;]) was always a quicker, more efficient function than count(distinct(id))&lt;/LI&gt;&lt;LI&gt;You had control over which rows were included in a count.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, on the last course I did (~6 months + ago) it was mentioned by the trainer that count() and sum() are now roughly equivalent from a performance point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some issues with count variables, that I may be able to get around using a count(distinct()) function in place of the existing sum() one, but the application in question is large - the count would be over 10's of millions of rows. Before I implement the change, I need to know how it will perform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the current perceived wisdom of the the two methods?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Feb 2016 15:05:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-02-08T15:05:02Z</dc:date>
    <item>
      <title>count(distinct(id)) vs sum(countValue) - Current Best Practice?</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-id-vs-sum-countValue-Current-Best-Practice/m-p/1072983#M358227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have always been of the mind that I should use sum(countValue) when building count(id) type logic, with the [countValue] having been added in the model script to facilitate this as a 1 where it should be counted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know there are two good reasons for doing this -&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;sum([&lt;EM&gt;a column full of 1s&lt;/EM&gt;]) was always a quicker, more efficient function than count(distinct(id))&lt;/LI&gt;&lt;LI&gt;You had control over which rows were included in a count.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, on the last course I did (~6 months + ago) it was mentioned by the trainer that count() and sum() are now roughly equivalent from a performance point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some issues with count variables, that I may be able to get around using a count(distinct()) function in place of the existing sum() one, but the application in question is large - the count would be over 10's of millions of rows. Before I implement the change, I need to know how it will perform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the current perceived wisdom of the the two methods?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 15:05:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-id-vs-sum-countValue-Current-Best-Practice/m-p/1072983#M358227</guid>
      <dc:creator />
      <dc:date>2016-02-08T15:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: count(distinct(id)) vs sum(countValue) - Current Best Practice?</title>
      <link>https://community.qlik.com/t5/QlikView/count-distinct-id-vs-sum-countValue-Current-Best-Practice/m-p/1072984#M358228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this blog post: &lt;A href="https://community.qlik.com/qlik-blogpost/3381"&gt;A Myth About Count(distinct …)&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 17:49:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-distinct-id-vs-sum-countValue-Current-Best-Practice/m-p/1072984#M358228</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-02-08T17:49:43Z</dc:date>
    </item>
  </channel>
</rss>

