<?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: How does Qlik know which table I want to evaluate in my chart expression in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069335#M17475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at Henric's blog post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3734"&gt;Count or Count distinct?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you already did, a common way to count the records of a key field in a specific table is to count &lt;EM&gt;another&lt;/EM&gt; field in that table, that shows a value for every key field value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regard to the results when counting a key field: The results are non deterministic, e.g. might depend on the load order of your tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Apr 2016 22:01:49 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-04-20T22:01:49Z</dc:date>
    <item>
      <title>How does Qlik know which table I want to evaluate in my chart expression</title>
      <link>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069331#M17471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Probably a basic questions, but I need to figure this out to understand how Qlik works. Any help is appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the following two tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table A&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; width: 75px; height: 90px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Col1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table B&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid #000000; width: 73px; height: 72px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Col1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the two tables both have a column with the name 'Col1', the two tables will be joined in Qliks data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I have a chart expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count(Col1)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) What will be the resulting value of the chart expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) How does Qlik decide which table to count?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) How can I qualify the table column name in the chart expression (e.g. by adding a table name) so that I'm in control of which table is counted?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 13:04:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069331#M17471</guid>
      <dc:creator />
      <dc:date>2016-04-20T13:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How does Qlik know which table I want to evaluate in my chart expression</title>
      <link>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069332#M17472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good question!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Answer is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Don't Count(KEYFIELD) !&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because QV can't determine which table you would like the count to be performed in and you can't specify / control it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The results are non-deterministic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(You can do a Count(DISTINCT KEYFIELD) without any problems though)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 15:41:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069332#M17472</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-20T15:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How does Qlik know which table I want to evaluate in my chart expression</title>
      <link>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069333#M17473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Under the software, QlikSense count the TOTAL of register. So, in your example, the count must be '7' and the sum must be 18.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 18:37:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069333#M17473</guid>
      <dc:creator />
      <dc:date>2016-04-20T18:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: How does Qlik know which table I want to evaluate in my chart expression</title>
      <link>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069334#M17474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Thanks for two interesting answers&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get a better understanding, I tried it in practice. See screenshot below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that swuehls "Don't Count(Keyfield)" is a good recommendation, because the answer I got didn't make much sense to me. The same goes for Sum(Keyfield), and I assume other aggregation functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the distinct keyword, the functions seem to count or sum the distinct keyfield values from both tables, combined. So, without the distinct keyword, I would have expected to get the result that Juan suggested, but I got the same results as with the distinct keyword. Which is what doesn't make any sense to me, and which is why I guess I'll stick to swuehls recommendation going forward.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to be constructive: To count the keyfield from table A, I added a new column (Col2) with nonsense values, and stuck a condition to ignore nulls in Col2 into the expression. I guess there is some kind of outer join going on, because this did give the expected result, 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anyone knows of any 'official' documentation about what is going on, it'd be interesting to see.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thx guys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Picture1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/122227_Picture1.png" style="height: 341px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 21:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069334#M17474</guid>
      <dc:creator />
      <dc:date>2016-04-20T21:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: How does Qlik know which table I want to evaluate in my chart expression</title>
      <link>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069335#M17475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at Henric's blog post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3734"&gt;Count or Count distinct?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you already did, a common way to count the records of a key field in a specific table is to count &lt;EM&gt;another&lt;/EM&gt; field in that table, that shows a value for every key field value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With regard to the results when counting a key field: The results are non deterministic, e.g. might depend on the load order of your tables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2016 22:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-does-Qlik-know-which-table-I-want-to-evaluate-in-my-chart/m-p/1069335#M17475</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-20T22:01:49Z</dc:date>
    </item>
  </channel>
</rss>

