<?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 query in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612266#M1099694</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting... that had me baffled a few days ago until I figured out a workaround.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2014 18:01:37 GMT</pubDate>
    <dc:creator>TKendrick20</dc:creator>
    <dc:date>2014-04-23T18:01:37Z</dc:date>
    <item>
      <title>Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612261#M1099689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've wondered why QV is set up in this way&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I have three tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1 has ten calls. CallNum 101 to 110&lt;/P&gt;&lt;P&gt;Table 2 has these ten calls plus a FSRNum (say 2 each) number for each = 20 CallNum/FSRNum combinations&lt;/P&gt;&lt;P&gt;Table 3 has these 10 calls plus 2 partnumbers for each CallNum and FSRNum = 40 Call/FSRNum/PartNum combinations&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I put a expression in as Count (CallNum) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I just have the dimension of CallNum the expression gives a total of 10&lt;/P&gt;&lt;P&gt;if I have the dimension of CallNum and FSRNum the expression gives a total of 20. (as it should be)&lt;/P&gt;&lt;P&gt;if I have the dimension of CallNum and FSRNum and PartNumber the expression gives a total of 20&amp;nbsp; (rather than 40)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is this? Its not a big (or even a small issue) issue but it seem to defy logic. Surely Count (CallNum) should count the total number of calls shown. And Count distinct just the distinct calls&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can Count (PartNum) to get the total of Parts so its not an issue but .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is there a setting to change this somewhere&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 15:48:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612261#M1099689</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-23T15:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612262#M1099690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can get the total as either&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count (PartNum)&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Sum(1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on whether Calls without parts should be included in the count or not&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 15:57:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612262#M1099690</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-23T15:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612263#M1099691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;try&lt;/P&gt;&lt;P&gt;Count({&amp;lt;FSRNum=,PartNum=&amp;gt;} CallNum)&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 16:04:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612263#M1099691</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2014-04-23T16:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612264#M1099692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this happen to be in a bar chart? I've been running into a similar issue because the "Total" in your example with three Dimensions is only taking into account the last segment. For instance, only counting PartNumber for the last FSRNum dimension. Don't know if that helps particularly, but you can kind of see what the logic is by turning on "Plot Values Inside Segments" if it does happen to be a bar chart.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 16:11:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612264#M1099692</guid>
      <dc:creator>TKendrick20</dc:creator>
      <dc:date>2014-04-23T16:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612265#M1099693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I understand the logic now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QV in effect converts table three into CallNum &amp;amp; FSRNum (and removes the separate CallNum and FSRNum in the table) when the synthetic join is done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So table 1 has CallNum&lt;/P&gt;&lt;P&gt;Table 2 has CallNum and FSRNum and CallNum &amp;amp; FSRNum&lt;/P&gt;&lt;P&gt;Table 3 has in effect just CallNum &amp;amp; FSRNum&amp;nbsp; and PartNum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the total number of CallNum is 20 not 40&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To count all three tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count (CallNum &amp;amp; FSRNum &amp;amp; PartNum) to include CallNum with no part&lt;/P&gt;&lt;P&gt;count (PartNum) exclude CallNum with no PartNum&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 17:30:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612265#M1099693</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-23T17:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612266#M1099694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting... that had me baffled a few days ago until I figured out a workaround.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 18:01:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612266#M1099694</guid>
      <dc:creator>TKendrick20</dc:creator>
      <dc:date>2014-04-23T18:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Count query</title>
      <link>https://community.qlik.com/t5/QlikView/Count-query/m-p/612267#M1099695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It gave the same result as count (CallNum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I surprised something that seems so simple is quite tricky. But by putting in the fields to count (with distinct when required) gives the correct result regardless of the dimensions used. This seems to be the safest option&lt;/P&gt;&lt;P&gt;EG&lt;/P&gt;&lt;P&gt;CallNum 100 FSRNum 1 PartNum ABC&lt;/P&gt;&lt;P&gt;CallNum 100 FSRNum 2 PartNum ABC&lt;/P&gt;&lt;P&gt;CallNum 100 FSRNum 3 PartNum ABD&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;count (CallNum &amp;amp; PartNum)&lt;/P&gt;&lt;P&gt;count (CallNum &amp;amp; FSRNum &amp;amp; PartNum)&lt;/P&gt;&lt;P&gt;count (distinct CallNum &amp;amp; FSRNum &amp;amp; PartNum) &lt;/P&gt;&lt;P&gt;ALL EQUAL 3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count (distinct CallNum &amp;amp; PartNum) EQUALS 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT (DISTINCT CallNum) = 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and after reading this I might start using count distinct now to reduce the risk of error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="" href="http://community.qlik.com/blogs/qlikviewdesignblog/2013/10/22/a-myth-about-countdistinct"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/10/22/a-myth-about-countdistinct&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 18:36:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-query/m-p/612267#M1099695</guid>
      <dc:creator>robert99</dc:creator>
      <dc:date>2014-04-23T18:36:52Z</dc:date>
    </item>
  </channel>
</rss>

