<?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 Looking for a formula re start / end dates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567992#M211799</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'm trying to work out a formula to calculate the vacant days on a given apartment. I have all the data I need (I think) in Qlikview - see table below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="751"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="14" width="78"&gt;UnitDesc&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="46"&gt;AptNo&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="57"&gt;AptSeq&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="64"&gt;AptSeq2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="59"&gt;TenNum&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="91"&gt;TenStartDate&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="108"&gt;TenStartDate1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="83"&gt;TenEndDate&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="88"&gt;TenEndDate1&lt;/TD&gt;&lt;TD class="xl72" width="77"&gt;Vacant Days&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;01/10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 110&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;13/09/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41165&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;12/10/2013&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt;41559&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;01/11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 111&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;13/10/2013&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;41560&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;12/10/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41924&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;02/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 212&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;11/09/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41163&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;29/08/2013&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt;41515&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;02/13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 213&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/09/2013&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;41518&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/08/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41882&lt;/TD&gt;&lt;TD class="xl71"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;03/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 312&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/07/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41091&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/06/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41455&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;03/13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 313&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/07/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41456&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/09/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41547&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;03/14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 314&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/10/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41548&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/09/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41912&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;04/11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 411&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/08/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41152&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/08/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41516&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;04/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 412&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/08/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41517&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/08/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41881&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;05/13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 513&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/12/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41249&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/12/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41613&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;05/14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 514&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/12/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41614&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/12/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41978&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;06/14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1014&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/10/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41188&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/10/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41552&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;06/15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1015&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/10/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41553&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/10/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41917&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;07/11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1211&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;09/09/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41161&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;08/09/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41525&lt;/TD&gt;&lt;TD class="xl73" style="border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;07/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1212&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;09/09/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41526&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/05/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41790&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically what I'm trying to do is get a formula that will take the end date of 1 tenant from the start date of the next tenant. For example above on line 3 a tenant has moved out on the 29/08/13 &amp;amp; the new tenant moves in on the 01/09/13 (see line 4) therefore the vacant days is 2 i.e. the 30/08 &amp;amp; 31/08. The above is just a sample of the data - this will be done for over 50 apartments over a range of time. The vacant days above were just calculated in excel not in Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any idea how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Apr 2014 11:26:57 GMT</pubDate>
    <dc:creator>anthony_kinsell</dc:creator>
    <dc:date>2014-04-28T11:26:57Z</dc:date>
    <item>
      <title>Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567992#M211799</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'm trying to work out a formula to calculate the vacant days on a given apartment. I have all the data I need (I think) in Qlikview - see table below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="751"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="14" width="78"&gt;UnitDesc&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="46"&gt;AptNo&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="57"&gt;AptSeq&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="64"&gt;AptSeq2&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="59"&gt;TenNum&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="91"&gt;TenStartDate&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="108"&gt;TenStartDate1&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="83"&gt;TenEndDate&lt;/TD&gt;&lt;TD class="xl64" style="border-left: none;" width="88"&gt;TenEndDate1&lt;/TD&gt;&lt;TD class="xl72" width="77"&gt;Vacant Days&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;01/10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 110&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;13/09/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41165&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;12/10/2013&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt;41559&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 1&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;01/11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 111&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;13/10/2013&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;41560&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;12/10/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41924&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;02/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 212&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;11/09/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41163&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;29/08/2013&lt;/TD&gt;&lt;TD class="xl69" style="border-top: none; border-left: none;"&gt;41515&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 2&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;02/13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 213&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/09/2013&lt;/TD&gt;&lt;TD class="xl68" style="border-top: none; border-left: none;"&gt;41518&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/08/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41882&lt;/TD&gt;&lt;TD class="xl71"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;03/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 312&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/07/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41091&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/06/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41455&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;03/13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 313&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/07/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41456&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/09/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41547&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 3&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;03/14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 314&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;01/10/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41548&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/09/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41912&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;04/11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 411&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/08/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41152&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/08/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41516&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 4&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;04/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 412&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/08/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41517&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;30/08/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41881&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;05/13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;13&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 513&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/12/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41249&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/12/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41613&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 5&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;05/14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt; 514&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/12/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41614&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/12/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41978&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;06/14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;14&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1014&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/10/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41188&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/10/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41552&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;06/15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;15&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1015&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;06/10/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41553&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;05/10/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41917&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;07/11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1211&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;09/09/2012&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41161&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;08/09/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41525&lt;/TD&gt;&lt;TD class="xl73" style="border-left: none;"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="14" style="border-top: none;"&gt;Apartment 12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;07/12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;1212&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;09/09/2013&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41526&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31/05/2014&lt;/TD&gt;&lt;TD class="xl67" style="border-top: none; border-left: none;"&gt;41790&lt;/TD&gt;&lt;TD class="xl71"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So basically what I'm trying to do is get a formula that will take the end date of 1 tenant from the start date of the next tenant. For example above on line 3 a tenant has moved out on the 29/08/13 &amp;amp; the new tenant moves in on the 01/09/13 (see line 4) therefore the vacant days is 2 i.e. the 30/08 &amp;amp; 31/08. The above is just a sample of the data - this will be done for over 50 apartments over a range of time. The vacant days above were just calculated in excel not in Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone got any idea how to do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:26:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567992#M211799</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T11:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567993#M211800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using straight table and function below()/above(), can take you to goal. Try to share your sample app.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:34:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567993#M211800</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-04-28T11:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567994#M211801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;Load *, RowNo() as NO Inline&lt;/P&gt;&lt;P&gt;[&lt;/P&gt;&lt;P&gt;&amp;nbsp; UnitDesc, AptNo, AptSeq, AptSeq2, TenNum, TenStartDate, TenStartDate1, TenEndDate, TenEndDate1&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 1, 1, 01/10, 10, 110, 13/09/2012, 41165, 12/10/2013, 41559&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 1, 1, 01/11, 11, 111, 13/10/2013, 41560, 12/10/2014, 41924&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 2, 2, 02/12, 12, 212, 11/09/2012, 41163, 29/08/2013, 41515&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 2, 2, 02/13, 13, 213, 01/09/2013, 41518, 31/08/2014, 41882&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 3, 3, 03/12, 12, 312, 01/07/2012, 41091, 30/06/2013, 41455&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 3, 3, 03/13, 13, 313, 01/07/2013, 41456, 30/09/2013, 41547&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 3, 3, 03/14, 14, 314, 01/10/2013, 41548, 30/09/2014, 41912&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 4, 4, 04/11, 11, 411, 31/08/2012, 41152, 30/08/2013, 41516&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 4, 4, 04/12, 12, 412, 31/08/2013, 41517, 30/08/2014, 41881&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 5, 5, 05/13, 13, 513, 06/12/2012, 41249, 05/12/2013, 41613&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 5, 5, 05/14, 14, 514, 06/12/2013, 41614, 05/12/2014, 41978&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 10, 10, 06/14, 14, 1014, 06/10/2012, 41188, 05/10/2013, 41552&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 10, 10, 06/15, 15, 1015, 06/10/2013, 41553, 05/10/2014, 41917&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 12, 12, 07/11, 11, 1211, 09/09/2012, 41161, 08/09/2013, 41525&lt;/P&gt;&lt;P&gt;&amp;nbsp; Apartment 12, 12, 07/12, 12, 1212, 09/09/2013, 41526, 31/05/2014, 41790&lt;/P&gt;&lt;P&gt;];&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;Final:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp; *,&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF(AptNo=Previous(AptNo),TenStartDate-Previous(TenEndDate)-1) as VacantDays&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;order By AptNo, TenNum;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567994#M211801</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-28T11:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567995#M211802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi tresesco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see your thinking with the above function, however I would only want to do that if the Apt no was the same - could this be done in an IF formula maybe?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:42:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567995#M211802</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T11:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567996#M211803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Manish, not quite following what you mean there?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567996#M211803</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T11:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567997#M211804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a script for you... .from script &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;VacantDays&lt;/SPAN&gt; is the field you required.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:52:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567997#M211804</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-28T11:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567998#M211805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Think this is where the confusion lies – you have created a script from my straight table data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps what is needed is something similar on the actual script I have used rather than on the data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567998#M211805</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T11:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567999#M211806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your actual script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 11:59:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/567999#M211806</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-28T11:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568000#M211807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are various tabs for different items - the temp for the above is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TurnoverTemp:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp; UnitRef,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitDesc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(UnitDesc,2) as AptNo, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitType,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantRef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(TenantRef,5) as AptSeq,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(TenantRef,2) as AptSeq2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenStart as TenStartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(TenStart) as TenStartDate1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenEnd as TenEndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(TenEnd) as TenEndDate1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(monthstart(TenEnd), 'MMM-YYYY') AS YearMonth&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;$(vLoadPath)\Block_B_Turnover_Analysis.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is then added to a data table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Concatenate (Data)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; UnitRef, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitDesc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitType,&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantRef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptSeq,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptSeq2, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantName, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenStartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenStartDate1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenEndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenEndDate1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptNo &amp;amp; AptSeq2 as TenNum&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident TurnoverTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table IncomeTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table ERV;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table TurnoverTemp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 12:02:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568000#M211807</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T12:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568001#M211808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've commented out all the other data to leave just the turnover temp &amp;amp; data tabs - script now looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TurnoverTemp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; UnitRef, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitDesc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(UnitDesc,2) as AptNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitType, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantRef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(TenantRef,5) as AptSeq,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(TenantRef,2) as AptSeq2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenStart as TenStartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(TenStart) as TenStartDate1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenEnd as TenEndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Num(TenEnd) as TenEndDate1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(monthstart(TenEnd), 'MMM-YYYY') AS YearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Right(UnitDesc,2) &amp;amp; Right(TenantRef,2) as TenNum&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;$(vLoadPath)\Block_B_Turnover_Analysis.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD Distinct&lt;/P&gt;&lt;P&gt;&amp;nbsp; UnitRef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitDesc,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptNo,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UnitType, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantRef,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptSeq,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AptSeq2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenantName,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenStartDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenStartDate1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenEndDate,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenEndDate1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; YearMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TenNum,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(AptNo = Previous(AptNo), TenStartDate1 - (Previous(TenEndDate1)-1)) as VacantDays&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Resident TurnoverTemp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Order By AptNo, TenNum;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Drop Table IncomeTemp;&lt;/P&gt;&lt;P&gt;//&lt;/P&gt;&lt;P&gt;//Drop Table ERV;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP Table TurnoverTemp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it's still not giving me the correct answer - it doesn't seem to be ordering the data by AptNo &amp;amp; then by TenNum. It's also doubled the number of end dates - i.e. it's gone from 110 to 220.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Results attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 14:05:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568001#M211808</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T14:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568002#M211809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you can upload sample file with only few data, better to answer, as from above script, it's difficult to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 14:07:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568002#M211809</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-28T14:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568003#M211810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See attached - appreciate the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data should show the correct number of turnovers - i.e. tenants leaving or renewing. I have commented out what I tried to do based on your previous e-mails as it's not giving the correct results - obviously I'm doing something wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 14:37:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568003#M211810</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T14:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568004#M211811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Manish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may be a better qvw file to use as it lets you see the other data I am importing - I have just commented all out to only load the data we are looking at.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anthony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 15:18:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568004#M211811</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-28T15:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Looking for a formula re start / end dates</title>
      <link>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568005#M211812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can nobody tell me how this can be done???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Apr 2014 08:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Looking-for-a-formula-re-start-end-dates/m-p/568005#M211812</guid>
      <dc:creator>anthony_kinsell</dc:creator>
      <dc:date>2014-04-30T08:20:56Z</dc:date>
    </item>
  </channel>
</rss>

