<?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 on Linked field problem in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314704#M116116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understood the question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;count({&amp;lt;target={'y'}&amp;gt;} accssNUmber)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2011 19:49:56 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-05-19T19:49:56Z</dc:date>
    <item>
      <title>Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314703#M116115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to get a total for the number of records in the main table where it is a 'y' value in a linked table. It seems to just be counting the number of 'y' values in the linked table not the number of records in the main table that are linked to a 'y'.&amp;nbsp; See varDenominator in example attached,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be welcomed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 19:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314703#M116115</guid>
      <dc:creator />
      <dc:date>2011-05-19T19:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314704#M116116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understood the question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;count({&amp;lt;target={'y'}&amp;gt;} accssNUmber)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 19:49:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314704#M116116</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-19T19:49:56Z</dc:date>
    </item>
    <item>
      <title>Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314705#M116117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to count a unique field in the table, if this does not exist, duplicate the keyfield and count the number of this duplicate, approximately as fllws:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Key,&lt;/P&gt;&lt;P&gt;Key AS KeyForThisTable&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you need to count KeyForThisTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;BR /&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 19:52:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314705#M116117</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2011-05-19T19:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314706#M116118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you check the attached file? Is it what you were looking for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 19:53:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314706#M116118</guid>
      <dc:creator />
      <dc:date>2011-05-19T19:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314707#M116119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;prieper wrote:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to count a unique field in the table, if this does not exist, duplicate the keyfield and count the number of this duplicate&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A straight count(field) will count every occurrence, unique ID or not.&amp;nbsp; The difficulty comes when you count a linking field appearing on more than one table, such as "Order" in this case.&amp;nbsp; I would typically then do a count(distinct) to get a proper count, but THAT would only return a row count if the field was a unique ID, which it is not in this case, which may have prompted your comment.&amp;nbsp; In this case, though, accssNUmber was only on the table we wanted to count the rows of, so served the purpose just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may, of course, have misunderstood the question.&amp;nbsp; It seems like we all interpreted the question differently.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 20:01:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314707#M116119</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-19T20:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314708#M116120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much everyone for your very fast help. John i think your first answer should do the trick. I need to go into work tommorow morning (am in london) and test it. Thanks again and i will let you know how it goes tommorow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 20:55:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314708#M116120</guid>
      <dc:creator />
      <dc:date>2011-05-19T20:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314709#M116121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; i have jsut checked and all seems to be workign so far. Many thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 10:18:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314709#M116121</guid>
      <dc:creator />
      <dc:date>2011-05-20T10:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314710#M116122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my future reference is there anyway i could have found the answer to my problem in the help or user manuals? or something i should have been searching for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 11:20:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314710#M116122</guid>
      <dc:creator />
      <dc:date>2011-05-20T11:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Count on Linked field problem</title>
      <link>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314711#M116123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm really not sure exactly how you could find the answer in the help text or reference manual.&amp;nbsp; I used set analysis, and there's a section on set analysis, but it's not going to tell you exactly what to do, though I suppose it's fairly clear once you have a good grasp of set analysis.&amp;nbsp; But probably nothing's going to tell you "you should use set analysis for this case" except for experience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course there's some explanation of count(), but it gives no indication of any potentially unexpected behavior when counting a linking field, or other ways of approaching the count in that case (such as counting a different field on the table, making a copy of the field you want to count on the table you want to count it on, or making a counter on the table you want to count it on and doing a sum() of the counter).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like count(if(target='y',accssNUmber)) works as well, though that's less efficient than set analysis.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2011 17:18:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Count-on-Linked-field-problem/m-p/314711#M116123</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-05-20T17:18:19Z</dc:date>
    </item>
  </channel>
</rss>

