<?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 to do this in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352149#M130637</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;This is how I would approach the problem. Please see attached.&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_13424381051717224" jivemacro_uid="_13424381051717224"&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;EmployeeID, StartDate, EndDate&lt;/P&gt;&lt;P&gt; 1, 2007/11/28, &lt;/P&gt;&lt;P&gt; 2, 2012/03/16, 2012/06/27&lt;/P&gt;&lt;P&gt; 3, 2008/02/20, &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;40, 2002/08/19, 2009/09/13&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (Data)&lt;/P&gt;&lt;P&gt;LOAD RowNo()+2000 As Year&lt;/P&gt;&lt;P&gt;AutoGenerate 12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Results:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ((Year(StartDate) &amp;lt;= Year) And (Len(EndDate) = 0 Or Year(EndDate) &amp;gt;= Year), 1, 0) As InEmploy&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(InEmploy) As Complement&lt;/P&gt;&lt;P&gt;Resident Results&lt;/P&gt;&lt;P&gt;Group By Year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Jul 2012 11:25:13 GMT</pubDate>
    <dc:creator>jonathandienst</dc:creator>
    <dc:date>2012-07-16T11:25:13Z</dc:date>
    <item>
      <title>How to do this in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352147#M130635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear I got a QVW document in which there is a table for employees where there are three columns:&lt;/P&gt;&lt;P&gt;EmployeeID, StartDate, EndDate&lt;/P&gt;&lt;P&gt;1, 2/7/2005,NULL&lt;/P&gt;&lt;P&gt;2,1/1/2009,NULL&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;44,5/5/2007, 16/7/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want on a chart to display the number of active employees by year and month&lt;/P&gt;&lt;P&gt;the years start from 2004&lt;/P&gt;&lt;P&gt;so for the above sample data in 2004 none of the employees above should be counted&lt;/P&gt;&lt;P&gt;in 2005 only employee one should be counted&lt;/P&gt;&lt;P&gt;in 2006, and 2008 only employee 1 is counted&lt;/P&gt;&lt;P&gt;in 2007 employee only 1 is counted but in may 1&amp;nbsp; and 44 are counted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in 2009,2010,2011 1,2, and 44 are counted&lt;/P&gt;&lt;P&gt;in 2012 before July only 1, and 2 are counted &lt;/P&gt;&lt;P&gt;but July and later all above employees are counted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now how to add records by year and month so that the above scenario is achieved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 10:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352147#M130635</guid>
      <dc:creator>ali_hijazi</dc:creator>
      <dc:date>2012-07-16T10:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352148#M130636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please send qvw file &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 11:08:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352148#M130636</guid>
      <dc:creator />
      <dc:date>2012-07-16T11:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352149#M130637</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;This is how I would approach the problem. Please see attached.&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_13424381051717224" jivemacro_uid="_13424381051717224"&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;EmployeeID, StartDate, EndDate&lt;/P&gt;&lt;P&gt; 1, 2007/11/28, &lt;/P&gt;&lt;P&gt; 2, 2012/03/16, 2012/06/27&lt;/P&gt;&lt;P&gt; 3, 2008/02/20, &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;40, 2002/08/19, 2009/09/13&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Join (Data)&lt;/P&gt;&lt;P&gt;LOAD RowNo()+2000 As Year&lt;/P&gt;&lt;P&gt;AutoGenerate 12;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Results:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ((Year(StartDate) &amp;lt;= Year) And (Len(EndDate) = 0 Or Year(EndDate) &amp;gt;= Year), 1, 0) As InEmploy&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum(InEmploy) As Complement&lt;/P&gt;&lt;P&gt;Resident Results&lt;/P&gt;&lt;P&gt;Group By Year;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 11:25:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352149#M130637</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2012-07-16T11:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this in script</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352150#M130638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Else you create a Fact table at month level where you pre-calculate (solution of Jonathan Dienst). The sum of the year will be the total of all months of the year (so *12 if we imagine there is no movement).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Else you create intervals (from - to) on which you link the employees if they are presents, and you do the count in the dashboard. This solution allow you to count employee only 1 time if you decide to display data per year instead of per month. The single interval is in fact the month itself, but you can aggregate more by doing intervals of n months if there is no movement in this interval of n months.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2012 14:42:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-do-this-in-script/m-p/352150#M130638</guid>
      <dc:creator>nstefaniuk</dc:creator>
      <dc:date>2012-07-16T14:42:48Z</dc:date>
    </item>
  </channel>
</rss>

