<?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 Population between 2 dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238119#M89063</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing you can do is set a variable, make an input box, and make a chart like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(if(vDate&amp;gt;=[date_of_birth] And vDate&amp;lt;=[date_of_death], 1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How you would get that in the script I would also like to know...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Mar 2011 19:13:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-03T19:13:19Z</dc:date>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238118#M89062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a table of people with a date of Birth and a date of death if the person is deceased.&lt;/P&gt;&lt;P&gt;I want to be able to select a range of dates and have a counter of population alive during that period.&lt;/P&gt;&lt;P&gt;I guess the way QV works, I need to generate a table containing a person alive for each date that exists between the earliest DOB and today.&lt;/P&gt;&lt;P&gt;How can I script this?&lt;/P&gt;&lt;P&gt;My table people table has&lt;/P&gt;&lt;P&gt;person_id,&lt;/P&gt;&lt;P&gt;date_of_birth,&lt;/P&gt;&lt;P&gt;date_of_death&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 18:55:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238118#M89062</guid>
      <dc:creator />
      <dc:date>2011-03-03T18:55:50Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238119#M89063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One thing you can do is set a variable, make an input box, and make a chart like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(if(vDate&amp;gt;=[date_of_birth] And vDate&amp;lt;=[date_of_death], 1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How you would get that in the script I would also like to know...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 19:13:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238119#M89063</guid>
      <dc:creator />
      <dc:date>2011-03-03T19:13:19Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238120#M89064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;sruault wrote:&lt;BR /&gt;I guess the way QV works, I need to generate a table containing a person alive for each date that exists between the earliest DOB and today.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Use IntervalMatch. First generate a Calendar table of Dates in the range. Then&lt;/P&gt;&lt;P&gt;intervalMatch (Date) LOAD date_of_birth, date_of_death RESIDENT mytable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 19:19:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238120#M89064</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-03-03T19:19:40Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238121#M89065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;you can use set analisys, it should be something like this:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;date_of_death={"&amp;gt;$(max(date_field))"},date_of_birth={"&amp;lt;$(max(date_field))"}&amp;gt;} person_id)&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;Regards!!!&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;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 19:23:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238121#M89065</guid>
      <dc:creator />
      <dc:date>2011-03-03T19:23:45Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238122#M89066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not really sure how intervalmatch works but if you have say 1,000,000 different people in the database and they live for 80 years each, won't that create an insane amount of data? I just tried intervalmatch on the data below and it turned 2 rows into 426... there's a calendar table I didn't post between the two tables. Did I do something wrong or is intervalmatch supposed to work like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;BR /&gt;LOAD * INLINE&lt;BR /&gt;[&lt;BR /&gt;ID, Start, End&lt;BR /&gt;1, 1/1/2009, 1/1/2010&lt;BR /&gt;2, 1/2/2011, 3/2/2011&lt;BR /&gt;]&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Final:&lt;BR /&gt;IntervalMatch (Date) LOAD [Start], [End] RESIDENT Table1;&lt;BR /&gt;JOIN LOAD * RESIDENT Table1;&lt;BR /&gt;DROP TABLE Table1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 20:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238122#M89066</guid>
      <dc:creator />
      <dc:date>2011-03-03T20:00:08Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238123#M89067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;trent.jones wrote:I'm not really sure how intervalmatch works but if you have say 1,000,000 different people in the database and they live for 80 years each, won't that create an insane amount of data?&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Yes, that's the dark side of IntervalMatch. It's an extremely useful feature but can become too large to work with. Gabriella's solution is probably better for this problem.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 20:22:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238123#M89067</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-03-03T20:22:47Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238124#M89068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found this thread below that I found pretty useful, maybe the OP will as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;http://community.qlik.com/forums/t/23510.aspx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Mar 2011 20:26:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238124#M89068</guid>
      <dc:creator />
      <dc:date>2011-03-03T20:26:29Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238125#M89069</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;Thank you all for your attention and answers.&lt;/P&gt;&lt;P&gt;[Customers]:&lt;BR /&gt;LOAD [Customer ID],&lt;BR /&gt; if(isnull([End Date]), DayStart(now()), [End Date]) as [EndDate],&lt;BR /&gt; DayStart([Start Date]) as [StartDate]&lt;BR /&gt;&lt;BR /&gt;FROM [../../QVD/Customer.qvd] (qvd)&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;I get the start date of my calendar :&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[Min Date]:&lt;BR /&gt;LOAD min([StartDate]) as "StartDate"&lt;BR /&gt;RESIDENT [Customers];&lt;BR /&gt;LET minDate = FieldValue('StartDate', 1);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Generate all dates&lt;/P&gt;&lt;P&gt;[Master Dates]:&lt;BR /&gt;LOAD date($(minDate) + recNo() - 1,'MM/DD/YY') as [Filter Date]&lt;BR /&gt;AUTOGENERATE(today() - $(minDate) + 1);&lt;BR /&gt;&lt;BR /&gt;LEFT JOIN (Customers)&lt;BR /&gt;intervalMatch ([Filter Date]) LOAD StartDate, EndDate RESIDENT Customers;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I execute the script, I get:&lt;/P&gt;&lt;P&gt;Error in expression:&lt;BR /&gt;')' expected&lt;BR /&gt;[Master Dates]:&lt;BR /&gt;LOAD date(5/25/2010 12:00:00 AM + recNo() - 1,'MM/DD/YY') as [Filter Date]&lt;BR /&gt;AUTOGENERATE(today() - 5/25/2010 12:00:00 AM + 1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 15:02:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238125#M89069</guid>
      <dc:creator />
      <dc:date>2011-03-04T15:02:19Z</dc:date>
    </item>
    <item>
      <title>Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238126#M89070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to use a different fieldname whane getting the mindate for your calendar.&lt;/P&gt;&lt;P&gt;[Min Date]:&lt;BR /&gt;LOAD min([StartDate]) as "&lt;STRONG&gt;Min&lt;/STRONG&gt;StartDate"&lt;BR /&gt;RESIDENT [Customers];&lt;BR /&gt;LET minDate = FieldValue('&lt;STRONG&gt;Min&lt;/STRONG&gt;StartDate', 1);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 20:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238126#M89070</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2011-03-04T20:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238127#M89071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please share your qvw file.&lt;/P&gt;&lt;P&gt;I am same facing the same problem but not regarding the population but the data related with my work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 10:17:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238127#M89071</guid>
      <dc:creator />
      <dc:date>2013-02-15T10:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: Population between 2 dates</title>
      <link>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238128#M89072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you please share your qvw file.&lt;/P&gt;&lt;P&gt;I am same facing the same problem but not regarding the population but the data related with my work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Feb 2013 10:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Population-between-2-dates/m-p/238128#M89072</guid>
      <dc:creator />
      <dc:date>2013-02-15T10:27:46Z</dc:date>
    </item>
  </channel>
</rss>

