<?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: having clause with count in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336054#M123964</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a where clause filtering out lines with EmpIDs=1, then you must have the same EmpID on several lines. You have a group by clause that looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you most likely have the same EmpID in several ProjectID (or SOID, FactID or combination of the group by fields). What do you want to do with these? Just loading one of the projects if the employee is linked to several does not make sense, or?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2012 09:50:03 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2012-05-04T09:50:03Z</dc:date>
    <item>
      <title>having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336041#M123951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a script, where I am loading the count of Employees in the preceeding load. Even if the EmpId exists 2 or more times it shows the count as 1 only. I want to have the count of employees as 2 if there are 2records of that employee in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;WHERE EmpIDs = 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD EmpID, count(EmpID) as EmpIDs, SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID&lt;/P&gt;&lt;P&gt;RESIDENT OrderTable&lt;/P&gt;&lt;P&gt;WHERE AssignmentStartDate &amp;gt;= 20110101 and AssignmentEndDate &amp;lt;= 20120101&lt;/P&gt;&lt;P&gt;GROUP BY EmpID,SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 07:48:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336041#M123951</guid>
      <dc:creator />
      <dc:date>2012-05-04T07:48:51Z</dc:date>
    </item>
    <item>
      <title>having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336042#M123952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The count of EmpID will always be 1 if you have EmpID in the group by clause. So, remove it from the group by clause and it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336042#M123952</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-05-04T08:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336043#M123953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I remove its not showing any data...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:10:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336043#M123953</guid>
      <dc:creator />
      <dc:date>2012-05-04T08:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336044#M123954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the count of employees to be finally shown in chart front end?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:24:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336044#M123954</guid>
      <dc:creator />
      <dc:date>2012-05-04T08:24:39Z</dc:date>
    </item>
    <item>
      <title>having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336045#M123955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to replace the "EmpID" with "Only(EmpID) as EmpID" in the list of loaded fields, also. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:26:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336045#M123955</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-05-04T08:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336046#M123956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robin: yes, I just want to show the count in a text if the EmpID exists only one time in the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:27:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336046#M123956</guid>
      <dc:creator />
      <dc:date>2012-05-04T08:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336047#M123957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Henric: Yes it worked, but still I am getting employees whose entries are two times in the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:35:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336047#M123957</guid>
      <dc:creator />
      <dc:date>2012-05-04T08:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336048#M123958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even though you have a preceding load with a where clause demanding EmpIDs=1 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:54:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336048#M123958</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-05-04T08:54:58Z</dc:date>
    </item>
    <item>
      <title>having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336049#M123959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From what i understand, can u just load the table plain as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;LOAD EmpID, EmpID, SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;RESIDENT OrderTable&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;WHERE AssignmentStartDate &amp;gt;= 20110101 and AssignmentEndDate &amp;lt;= 20120101;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;\and then simply use count(distinct EmpID)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Thanks,&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; color: #636363; font-family: Arial;"&gt;Robinson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 08:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336049#M123959</guid>
      <dc:creator />
      <dc:date>2012-05-04T08:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336050#M123960</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;Just replace in your code:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;count(EmpID) as EmpIDs&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;by:&lt;/P&gt;&lt;P&gt;&lt;CODE&gt;count(1) as EmpIDs&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 09:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336050#M123960</guid>
      <dc:creator>vincent_ardiet</dc:creator>
      <dc:date>2012-05-04T09:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336051#M123961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vincent, I used the same; but still if EmpID is more than 1 time in the table its showing the data.&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;Henric: I have used EmpIDs=1 in the preceeding load&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 09:28:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336051#M123961</guid>
      <dc:creator />
      <dc:date>2012-05-04T09:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336052#M123962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Are you sure this is not comming from the data ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you see an EmpID twice, is it with the same value in the folowing columns :&lt;/P&gt;&lt;P&gt;SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because, as they are used in your GROUP BY, they must be the same. Else you will count the number of time that the combinaison of all (EmpID,SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID) is appearing in your datasource.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 09:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336052#M123962</guid>
      <dc:creator>vincent_ardiet</dc:creator>
      <dc:date>2012-05-04T09:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336053#M123963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;Please can you upload the sample QV file? It helps us to look at the data.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: tahoma,arial,helvetica,sans-serif;"&gt;DV&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 09:47:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336053#M123963</guid>
      <dc:creator>IAMDV</dc:creator>
      <dc:date>2012-05-04T09:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336054#M123964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have a where clause filtering out lines with EmpIDs=1, then you must have the same EmpID on several lines. You have a group by clause that looks like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUP BY SOID,SONAME,ProjectID,AssignmentStartDate,AssignmentEndDate,FactID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you most likely have the same EmpID in several ProjectID (or SOID, FactID or combination of the group by fields). What do you want to do with these? Just loading one of the projects if the employee is linked to several does not make sense, or?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 09:50:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336054#M123964</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-05-04T09:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336055#M123965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please find the QV and the sample data attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 10:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336055#M123965</guid>
      <dc:creator />
      <dc:date>2012-05-04T10:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336056#M123966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;P&gt;Table1:&lt;BR /&gt;LOAD &lt;BR /&gt;&amp;nbsp; EmpId, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProjectId, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AssignmentStartDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AssignmentEndDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SoId, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SoLine&lt;BR /&gt;FROM &lt;SPAN style="text-decoration: line-through;"&gt;H&lt;/SPAN&gt;D:\SampleData.xls (biff, embedded labels, table is Sheet3$) ;&lt;/P&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TbCounter:&lt;BR /&gt;LOAD&lt;BR /&gt;EmpId, count(1) as Counter&lt;BR /&gt;Resident Table1&lt;BR /&gt;Group By EmpId ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Inner Join (Table1) Load&lt;BR /&gt;EmpId&lt;BR /&gt;Resident TbCounter&lt;BR /&gt;Where Counter=1 ;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;﻿&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Drop Table TbCounter ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 11:33:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336056#M123966</guid>
      <dc:creator>vincent_ardiet</dc:creator>
      <dc:date>2012-05-04T11:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336057#M123967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here send you your Having Test.qvs modified, hope this is wath you need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.-&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 11:41:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336057#M123967</guid>
      <dc:creator />
      <dc:date>2012-05-04T11:41:54Z</dc:date>
    </item>
    <item>
      <title>having clause with count</title>
      <link>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336058#M123968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thank You all for your help:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 12:08:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/having-clause-with-count/m-p/336058#M123968</guid>
      <dc:creator />
      <dc:date>2012-05-04T12:08:05Z</dc:date>
    </item>
  </channel>
</rss>

