<?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 wrong key field count in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397923#M698714</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;I have found that a chart result (field count) dipends on script load order. Here is the simple case I built to isolate the problem. The script is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13575534529864389" jivemacro_uid="_13575534529864389"&gt;&lt;P&gt;table_ab:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;A, B&lt;/P&gt;&lt;P&gt;10, 20&lt;/P&gt;&lt;P&gt;12, 22&lt;/P&gt;&lt;P&gt;12, 23&lt;/P&gt;&lt;P&gt;17, 23&lt;/P&gt;&lt;P&gt;18, 26&lt;/P&gt;&lt;P&gt;19, 26&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table_bc:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;B, C&lt;/P&gt;&lt;P&gt;20, 31&lt;/P&gt;&lt;P&gt;20, 32&lt;/P&gt;&lt;P&gt;25, 33&lt;/P&gt;&lt;P&gt;25, 34&lt;/P&gt;&lt;P&gt;26, 35&lt;/P&gt;&lt;P&gt;26, 36&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see there are two tables connected by field B. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to count B using B as dimension I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Count(B)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;20&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;23&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;25&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;26&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first strange thing is that values 20 anf 25 are counted once even if, in table_bc, they appear twice. I'm not sure about value 26, maybe count should be 4?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second strange thing is that if I invert table load order (table_bc loaded before table_ab) the count of B changes: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Count(B)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;20&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;23&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;25&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;26&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it seems that the count is "made primary" on table_bc (the first one read) since valie 20 has count equal to 1 and value 23 has count equal to 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we have two (connected) strange things: &lt;/P&gt;&lt;P&gt;1) count of key field seems to have a "primary" table, &lt;/P&gt;&lt;P&gt;2) final result depends on table load ordere&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody explain me this behaviour?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance to all replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jan 2013 08:57:15 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-07T08:57:15Z</dc:date>
    <item>
      <title>wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397923#M698714</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;I have found that a chart result (field count) dipends on script load order. Here is the simple case I built to isolate the problem. The script is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13575534529864389" jivemacro_uid="_13575534529864389"&gt;&lt;P&gt;table_ab:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;A, B&lt;/P&gt;&lt;P&gt;10, 20&lt;/P&gt;&lt;P&gt;12, 22&lt;/P&gt;&lt;P&gt;12, 23&lt;/P&gt;&lt;P&gt;17, 23&lt;/P&gt;&lt;P&gt;18, 26&lt;/P&gt;&lt;P&gt;19, 26&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table_bc:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;B, C&lt;/P&gt;&lt;P&gt;20, 31&lt;/P&gt;&lt;P&gt;20, 32&lt;/P&gt;&lt;P&gt;25, 33&lt;/P&gt;&lt;P&gt;25, 34&lt;/P&gt;&lt;P&gt;26, 35&lt;/P&gt;&lt;P&gt;26, 36&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see there are two tables connected by field B. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to count B using B as dimension I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Count(B)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;20&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;23&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;25&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;26&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first strange thing is that values 20 anf 25 are counted once even if, in table_bc, they appear twice. I'm not sure about value 26, maybe count should be 4?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second strange thing is that if I invert table load order (table_bc loaded before table_ab) the count of B changes: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Count(B)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;20&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;23&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;25&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;26&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it seems that the count is "made primary" on table_bc (the first one read) since valie 20 has count equal to 1 and value 23 has count equal to 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we have two (connected) strange things: &lt;/P&gt;&lt;P&gt;1) count of key field seems to have a "primary" table, &lt;/P&gt;&lt;P&gt;2) final result depends on table load ordere&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anybody explain me this behaviour?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance to all replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 08:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397923#M698714</guid>
      <dc:creator />
      <dc:date>2013-01-07T08:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397924#M698715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;i think if you connected two table then one field must be common as a primary key.&lt;/P&gt;&lt;P&gt;here field B is not primary key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 09:02:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397924#M698715</guid>
      <dc:creator />
      <dc:date>2013-01-07T09:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397925#M698716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN class="replyToName" style="font-size: 14.666666984558105px;"&gt;vishwaranjan&lt;/SPAN&gt;, thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe I don't understand well: what do you mean by "primary" key? The two tables are connected by common field B as can be see in table viewer where the two tables are connected by B indicated as [Key], but not "primary"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 09:09:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397925#M698716</guid>
      <dc:creator />
      <dc:date>2013-01-07T09:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397926#M698717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is "illegal" to use count(B) when B is a key field.&amp;nbsp; You can use count (distinct B) - it will be 1 in each row.&lt;/P&gt;&lt;P&gt;Or, create duplicate keys in each table, say B as B1 in one table, and B as B2 in another table, and use count(B1) and count(B2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jan 2013 19:06:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397926#M698717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-07T19:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397927#M698718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael, thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have some reference to documentation about this "illegality" (QV manual, other comunity posts, ...)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to have more deatils about what is illegal: reading your answer it seems that you can never user key fields in expressions!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filippo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 06:49:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397927#M698718</guid>
      <dc:creator />
      <dc:date>2013-01-08T06:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397928#M698719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why dont you try for joins ????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 07:14:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397928#M698719</guid>
      <dc:creator>sujeetsingh</dc:creator>
      <dc:date>2013-01-08T07:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397929#M698720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, at the moment I'm not trying to solve the problem (i.e. find the correct value for count(B)), I want to understand why the actual formulation is not correct, in order to avoid problems in the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 07:26:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397929#M698720</guid>
      <dc:creator />
      <dc:date>2013-01-08T07:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397930#M698721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;i think,the concept is that when you join two table then one field must be common and that field must be primary key,&lt;/P&gt;&lt;P&gt;because on the basis of primary key we join two tables, so we make that field as a primary key of parent table,and make same field as a foregien key of of child table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 07:57:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397930#M698721</guid>
      <dc:creator />
      <dc:date>2013-01-08T07:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397931#M698722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I agree with you if you speak about "tradional" systems, but I think that in QlikView there isn't any concept of "primary key", "foreign key", "parent table" or "child table". All keys are simply keys and all tables are simply tables, with no hierarchy (of course, if I'm wrong, please correct me). I think that this "lack" of hierarchy is one of the strengths of QV.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 08:17:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397931#M698722</guid>
      <dc:creator />
      <dc:date>2013-01-08T08:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397932#M698723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;table_ab:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;A, B&lt;/P&gt;&lt;P&gt;10, 20&lt;/P&gt;&lt;P&gt;12, 22&lt;/P&gt;&lt;P&gt;12, 23&lt;/P&gt;&lt;P&gt;17, 23&lt;/P&gt;&lt;P&gt;18, 26&lt;/P&gt;&lt;P&gt;19, 26&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate&lt;/P&gt;&lt;P&gt;table_bc:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;B, C&lt;/P&gt;&lt;P&gt;20, 31&lt;/P&gt;&lt;P&gt;20, 32&lt;/P&gt;&lt;P&gt;25, 33&lt;/P&gt;&lt;P&gt;25, 34&lt;/P&gt;&lt;P&gt;26, 35&lt;/P&gt;&lt;P&gt;26, 36&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;the output show like this&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TH bgcolor="#f5f5f5"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;B&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;Count(B)&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;20&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;3&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;22&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;1&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;23&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;25&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;26&lt;/SPAN&gt; &lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;write in expression&amp;nbsp;&amp;nbsp;&amp;nbsp; count(B)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 08:56:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397932#M698723</guid>
      <dc:creator />
      <dc:date>2013-01-08T08:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397933#M698724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this in your script&lt;/P&gt;&lt;P&gt;table_ab:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;A, B&lt;/P&gt;&lt;P&gt;10, 20&lt;/P&gt;&lt;P&gt;12, 22&lt;/P&gt;&lt;P&gt;12, 23&lt;/P&gt;&lt;P&gt;17, 23&lt;/P&gt;&lt;P&gt;18, 26&lt;/P&gt;&lt;P&gt;19, 26&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate (table_ab ) Add&lt;/P&gt;&lt;P&gt;table_bc:&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;B, C&lt;/P&gt;&lt;P&gt;20, 31&lt;/P&gt;&lt;P&gt;20, 32&lt;/P&gt;&lt;P&gt;25, 33&lt;/P&gt;&lt;P&gt;25, 34&lt;/P&gt;&lt;P&gt;26, 35&lt;/P&gt;&lt;P&gt;26, 36&lt;/P&gt;&lt;P&gt;]&lt;/P&gt;&lt;P&gt;where&amp;nbsp; exists (B);&lt;/P&gt;&lt;P&gt;in pivot table take dimension B&lt;/P&gt;&lt;P&gt;and in expression&lt;/P&gt;&lt;P&gt;count(B)&lt;/P&gt;&lt;P&gt;hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 08:56:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397933#M698724</guid>
      <dc:creator>er_mohit</dc:creator>
      <dc:date>2013-01-08T08:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397934#M698725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to everybody for the possible solutions to the problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However what I would like to know is not how to solve the problem, but to understand if there is some rule which says: "you cannot make charts with the same key field as both dimension and expression" or something similar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there something in the documentation abiut that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filippo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 12:34:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397934#M698725</guid>
      <dc:creator />
      <dc:date>2013-01-08T12:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: key field count depending on script table load order</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397935#M698726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Filippo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the eariler QV versions (maybe up to QV7, but I don't have that's old versions installed now), if you try to create expression count(&lt;SPAN style="color: #ff0000;"&gt;B&lt;/SPAN&gt;) where B is a key field, the expression dialogue made this "B" red, and the mesage was something like "dangerous ffield".&amp;nbsp; This warning was removed later, but it didn't change the fact.&amp;nbsp; There could be multiple way to define what count(B) means.&lt;/P&gt;&lt;P&gt;Notice, that if you create a list box for a key field, you cannot use property "Show Frequency" - it is for the same reason.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 13:19:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397935#M698726</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-08T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397936#M698727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Filippo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just adding to what Michael already said:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've read this statement from time to time, but can't remember where and searching the Help file and reference manual haven't shown a reference neither.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only thing I've found (but I trust Henric that he knows QV well enough):&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading active_link" href="https://community.qlik.com/message/265064#265064" title="http://community.qlik.com/message/265064#265064"&gt;http://community.qlik.com/message/265064&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 14:42:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397936#M698727</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-01-08T14:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: wrong key field count</title>
      <link>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397937#M698728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, foolowing your link and searching thr forum for 'count "key field"' I have found some refernces saying that aggregation functions may give wrong results if applied to key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On page 367 of reference manual (V 11, paragraph: Frequency Information in Associating Fields) there is someinformation about that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 17:52:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/wrong-key-field-count/m-p/397937#M698728</guid>
      <dc:creator />
      <dc:date>2013-01-10T17:52:17Z</dc:date>
    </item>
  </channel>
</rss>

