<?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: Number of employees at given date in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170756#M380583</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply use my script and add&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;COUNT({&amp;lt;Date = {'$(=Max(Date))'}&amp;gt;}Distinct EmployeeID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Use Date filed as List Box&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2016 08:53:41 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2016-06-22T08:53:41Z</dc:date>
    <item>
      <title>Number of employees at given date</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170751#M380578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easy question but I've had a mental block.&amp;nbsp; I'm looking to find out the current number of employees I have at any chosen date. The fields I have are CalMonth, CalYear, CalDay (Make up my calendar controls), Person ID, Leaving Date and Starting Date. Starting Date links to calendar, so whichever starting date is selected I want to know how many people were employed on that date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So Leaving date must be null or greater than the date selected in the calendar and Starting date must be less than the date selected. Easy?&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, 22 Jun 2016 08:25:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170751#M380578</guid>
      <dc:creator>kevbrown</dc:creator>
      <dc:date>2016-06-22T08:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Number of employees at given date</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170752#M380579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you post a sample qvw with representative data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:29:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170752#M380579</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2016-06-22T08:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Number of employees at given date</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170753#M380580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could try IntervalMatch (&lt;A href="https://community.qlik.com/qlik-blogpost/3037"&gt;IntervalMatch&lt;/A&gt;) combined with something like if(Len(LeavingDate)=0, Today()+1, LeavingDate)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:31:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170753#M380580</guid>
      <dc:creator>ciaran_mcgowan</dc:creator>
      <dc:date>2016-06-22T08:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Number of employees at given date</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170754#M380581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14665853435484783" jivemacro_uid="_14665853435484783"&gt;
&lt;P&gt;Employee:&lt;/P&gt;
&lt;P&gt;Load EmployeeID, StartingDate, If(Len(Trim(LeavingDate))=0,Date(YearEnd(Today())),LeavingDate) as LeavingDate Inline&lt;/P&gt;
&lt;P&gt;[&lt;/P&gt;
&lt;P&gt;&amp;nbsp; EmployeeID, StartingDate, LeavingDate&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 1, 10/01/2016,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 2, 12/01/2016, 25/04/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 3, 15/02/2016, 01/06/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 4, 24/02/2016,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 5, 01/03/2016, 15/05/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 6, 14/04/2016,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 7, 20/04/2016, 18/06/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 8, 01/05/2016, 22/06/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 9, 11/05/2016, 12/06/2016&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 10, 22/05/2016,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 11, 01/06/2016,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; 12, 15/06/2016,&amp;nbsp;&amp;nbsp;&amp;nbsp; 20/06/2016&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Temp_MinMaxDate:&lt;/P&gt;
&lt;P&gt;Load Min(StartingDate) as MinDate, Today()+1 as MaxDate Resident Employee;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let vMinDate = Num(Peek('MinDate',0,'Temp_MinMaxDate'));&lt;/P&gt;
&lt;P&gt;Let vMaxDate = Num(Peek('MaxDate',0,'Temp_MinMaxDate'));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Drop Table Temp_MinMaxDate;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Calendar:&lt;/P&gt;
&lt;P&gt;Load Date, Year(Date) as Year, Month(Date) as Month ,Week(Date) as Week;&lt;/P&gt;
&lt;P&gt;Load&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Date($(vMinDate) + IterNo() - 1) as Date&lt;/P&gt;
&lt;P&gt;AutoGenerate 1&lt;/P&gt;
&lt;P&gt;While $(vMinDate) + IterNo() - 1 &amp;lt;= $(vMaxDate);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;IntervalMatch(Date)&lt;/P&gt;
&lt;P&gt;Load StartingDate, LeavingDate Resident Employee;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now create a straight table.&lt;/P&gt;&lt;P&gt;Dimension &lt;/P&gt;&lt;P&gt;Date&lt;/P&gt;&lt;P&gt;Expression&lt;/P&gt;&lt;P&gt;COUNT(Distinct EmployeeID)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:49:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170754#M380581</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-06-22T08:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Number of employees at given date</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170755#M380582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to create a Text box with the figure in it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170755#M380582</guid>
      <dc:creator>kevbrown</dc:creator>
      <dc:date>2016-06-22T08:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Number of employees at given date</title>
      <link>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170756#M380583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Simply use my script and add&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;COUNT({&amp;lt;Date = {'$(=Max(Date))'}&amp;gt;}Distinct EmployeeID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #f2f2f2;"&gt;Use Date filed as List Box&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2016 08:53:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Number-of-employees-at-given-date/m-p/1170756#M380583</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-06-22T08:53:41Z</dc:date>
    </item>
  </channel>
</rss>

