<?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: Count(Distinct ....) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900472#M313281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael for your input,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 May 2015 19:36:51 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-05-20T19:36:51Z</dc:date>
    <item>
      <title>Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900470#M313279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to count the distinct number of prescriptions in a data base under a field [Script Number] and then calculate the market share based on the number of prescriptions.&amp;nbsp; My results are as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2015-05-20 at 08.05.52.png" class="jive-image image-1" src="/legacyfs/online/87080_Screen Shot 2015-05-20 at 08.05.52.png" style="height: 314px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;The Market TRx (number of market prescriptions per area) column is based on the expression Count (Distinct [Script Number]).&amp;nbsp; The percentage share is based on the same expression i.e. Count (Distinct [Script Number]) but on a relative basis.&amp;nbsp; The results are obviously wrong as the total prescription count of 220,524 is exceeded by the sum count of the individual values per category as above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 18:56:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900470#M313279</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-20T18:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900471#M313280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The result may be not wrong.&amp;nbsp; It only tells that many Script Numbers are counted in more than one Group.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 19:05:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900471#M313280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-20T19:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900472#M313281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael for your input,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 19:36:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900472#M313281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-20T19:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900473#M313282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used the following expression posted by one Clever Anjos, since deleted.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;sum( &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp; aggr(&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp; Count (Distinct [Script Number]),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&amp;nbsp; [Script Number]&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #666666; font-family: Helvetica, Arial, sans-serif; font-size: 14px;"&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;The above worked for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Thanks Clever&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 19:39:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900473#M313282</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-20T19:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900474#M313283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;weird thing, when I saved the post, got an error message, &lt;/P&gt;&lt;P&gt;Good to know it worked &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 19:52:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900474#M313283</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-05-20T19:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900475#M313284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whatever works for you &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I assume you'll get the same result with the original expression simply by changing total mode from "expression total" to "sum of rows" (only if it is a straight table of course).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2015 20:09:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900475#M313284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-20T20:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Count(Distinct ....)</title>
      <link>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900476#M313285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Michael&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes it is a straight table.&amp;nbsp; Changing the total mode to 'sum of rows'&amp;nbsp; gives a different result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2015 16:21:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-Distinct/m-p/900476#M313285</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-05-21T16:21:49Z</dc:date>
    </item>
  </channel>
</rss>

