<?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: Creating historical position from start/end dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-historical-position-from-start-end-dates/m-p/848358#M297717</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 think this could help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Month(Start_Date) as "Month_Start_Date",&lt;/P&gt;&lt;P&gt;Month(End_Date) as "Month_End_Date"&lt;/P&gt;&lt;P&gt;Inline [&lt;/P&gt;&lt;P&gt;Staff_id, Start_Date, End_Date&lt;/P&gt;&lt;P&gt;1, 05/02/2015, 16/05/2015&lt;/P&gt;&lt;P&gt;2, 01/03/2015, 24/04/2015&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Dates:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(End_Date) as "MaxDate",&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Start_Date) as "MinDate"&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMaxDate = Peek('MaxDate',0,'Dates');&lt;/P&gt;&lt;P&gt;Let vMinDate = Peek('MinDate',0,'Dates');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right Join(Data)&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date(RecNo() + $(vMinDate) - 1)) as "Month"&lt;/P&gt;&lt;P&gt;AutoGenerate $(vMaxDate) - $(vMinDate) + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Data2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Where Month &amp;gt;= Month(Start_Date) and Month &amp;lt;= Month(End_Date);&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in the expression use: count(DISTINCT Staff_id)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Jun 2015 13:56:04 GMT</pubDate>
    <dc:creator>fvelascog72</dc:creator>
    <dc:date>2015-06-08T13:56:04Z</dc:date>
    <item>
      <title>Creating historical position from start/end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-historical-position-from-start-end-dates/m-p/848357#M297716</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 have a data set that consists, essentially, of staff name, start date, end date, 1 record per person.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is create a chart that displays a historical staff count, with month as the dimension, and count of staff employed within that month as the expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So a staff member whose start date was 05/02/15 and end date was 16/05/15 would be counted in Feb, Mar, April, May.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 13:05:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-historical-position-from-start-end-dates/m-p/848357#M297716</guid>
      <dc:creator />
      <dc:date>2015-06-08T13:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating historical position from start/end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-historical-position-from-start-end-dates/m-p/848358#M297717</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 think this could help:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*,&lt;/P&gt;&lt;P&gt;Month(Start_Date) as "Month_Start_Date",&lt;/P&gt;&lt;P&gt;Month(End_Date) as "Month_End_Date"&lt;/P&gt;&lt;P&gt;Inline [&lt;/P&gt;&lt;P&gt;Staff_id, Start_Date, End_Date&lt;/P&gt;&lt;P&gt;1, 05/02/2015, 16/05/2015&lt;/P&gt;&lt;P&gt;2, 01/03/2015, 24/04/2015&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Dates:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; Max(End_Date) as "MaxDate",&lt;/P&gt;&lt;P&gt;&amp;nbsp; Min(Start_Date) as "MinDate"&lt;/P&gt;&lt;P&gt;Resident Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMaxDate = Peek('MaxDate',0,'Dates');&lt;/P&gt;&lt;P&gt;Let vMinDate = Peek('MinDate',0,'Dates');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table Dates;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right Join(Data)&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; Month(Date(RecNo() + $(vMinDate) - 1)) as "Month"&lt;/P&gt;&lt;P&gt;AutoGenerate $(vMaxDate) - $(vMinDate) + 1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Data2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;Resident Data&lt;/P&gt;&lt;P&gt;Where Month &amp;gt;= Month(Start_Date) and Month &amp;lt;= Month(End_Date);&lt;/P&gt;&lt;P&gt;DROP Table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in the expression use: count(DISTINCT Staff_id)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jun 2015 13:56:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-historical-position-from-start-end-dates/m-p/848358#M297717</guid>
      <dc:creator>fvelascog72</dc:creator>
      <dc:date>2015-06-08T13:56:04Z</dc:date>
    </item>
  </channel>
</rss>

