<?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: Calculating Date Difference Between Rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307659#M826798</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;Dimension: &lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Expression Date of 1st Call:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min ({&amp;lt;[Encounter Type]={'TELEPHONE'}&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Date of 1st Visit:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min ({&amp;lt;[Encounter Type]={'OFFICE VISIT'}&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Difference Between Dates:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min ({&amp;lt;[Encounter Type]={'OFFICE VISIT'}&amp;gt;}Date)-Min ({&amp;lt;[Encounter Type]={'TELEPHONE'}&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Result (I added another ID)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/170216_1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Look attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ragards,&lt;/P&gt;&lt;P&gt;Andrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Jul 2017 04:11:14 GMT</pubDate>
    <dc:creator>ahaahaaha</dc:creator>
    <dc:date>2017-07-14T04:11:14Z</dc:date>
    <item>
      <title>Calculating Date Difference Between Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307657#M826796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are trying to work out calculations to tell us the difference between the first time a patient was called for a referral and the first visit they came to the clinic (=Time to Be Seen).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data looks like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 746px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" width="191"&gt;ID&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="188"&gt;Encounter Type&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="175"&gt;Reason for Visit&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="192"&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="192"&gt;2/20/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="192"&gt;12/16/2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="192"&gt;5/11/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="188"&gt;TELEPHONE&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="175"&gt;Call&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="192"&gt;11/8/2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="188"&gt;TELEPHONE&lt;/TD&gt;&lt;TD class="xl65" style="border-top: none; border-left: none;" width="175"&gt;Call&lt;/TD&gt;&lt;TD class="xl66" style="border-top: none; border-left: none;" width="192"&gt;10/31/2016&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The end Result would be&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="746"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="191"&gt;ID&lt;/TD&gt;&lt;TD class="xl65" width="188"&gt;Date of 1st Call&lt;/TD&gt;&lt;TD class="xl65" width="175"&gt;Date of 1st Visit&lt;/TD&gt;&lt;TD width="192"&gt;Difference Between Dates&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307657#M826796</guid>
      <dc:creator>proctors</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date Difference Between Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307658#M826797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can u explain the result set?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 03:07:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307658#M826797</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-07-14T03:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date Difference Between Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307659#M826798</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;Dimension: &lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Expression Date of 1st Call:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min ({&amp;lt;[Encounter Type]={'TELEPHONE'}&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Date of 1st Visit:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min ({&amp;lt;[Encounter Type]={'OFFICE VISIT'}&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Difference Between Dates:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Min ({&amp;lt;[Encounter Type]={'OFFICE VISIT'}&amp;gt;}Date)-Min ({&amp;lt;[Encounter Type]={'TELEPHONE'}&amp;gt;}Date)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Result (I added another ID)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/170216_1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Look attached file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ragards,&lt;/P&gt;&lt;P&gt;Andrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 04:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307659#M826798</guid>
      <dc:creator>ahaahaaha</dc:creator>
      <dc:date>2017-07-14T04:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date Difference Between Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307660#M826799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works pretty well!&amp;nbsp; However, when I looked at other IDs, we saw that some had the following. In this scenario, the min Office visit comes before the telephone call. We want to look forward, someone calls, then has a visit, thus ignoring visits before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="20" style="border: 0px solid black;" width="191"&gt;ID&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="188"&gt;Encounter Type&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="175"&gt;Reason for Visit&lt;/TD&gt;&lt;TD class="xl63" style="border: 0px solid black; border-left: none;" width="192"&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border: 0px solid black; border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border: 0px solid black; border-left: none; border-top: none;" width="192"&gt;2/20/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border: 0px solid black; border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border: 0px solid black; border-left: none; border-top: none;" width="192"&gt;12/16/2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border: 0px solid black; border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border: 0px solid black; border-left: none; border-top: none;" width="192"&gt;5/11/2017&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border: 0px solid black; border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="188"&gt;TELEPHONE&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="175"&gt;Call&lt;/TD&gt;&lt;TD class="xl66" style="border: 0px solid black; border-left: none; border-top: none;" width="192"&gt;11/8/2016&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border: 0px solid black; border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="188"&gt;&lt;STRONG&gt;TELEPHONE&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="175"&gt;Call&lt;/TD&gt;&lt;TD class="xl66" style="border: 0px solid black; border-left: none; border-top: none;" width="192"&gt;&lt;STRONG&gt;10/31/2016&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" style="border: 0px solid black; border-top: none;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="188"&gt;OFFICE VISIT&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black; border-left: none; border-top: none;" width="175"&gt;Visit&lt;/TD&gt;&lt;TD class="xl66" style="border: 0px solid black; border-left: none; border-top: none;" width="192"&gt;4/2/2016&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I adjust the expression so that it only looks at the first Office Visit after the 1st Telephone call?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Result&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 746px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0px solid black;" width="191"&gt;ID&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black;" width="188"&gt;Date of 1st Call&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black;" width="175"&gt;Date of 1st Visit (after 1st call)&lt;/TD&gt;&lt;TD style="border: 0px solid black;" width="192"&gt;Difference Between Dates&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20" style="border: 0px solid black;" width="191"&gt;9999&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black;" width="188"&gt;10/31/2016&lt;/TD&gt;&lt;TD class="xl65" style="border: 0px solid black;" width="175"&gt;12/16/2016&lt;/TD&gt;&lt;TD style="border: 0px solid black;" width="192"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 12:51:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307660#M826799</guid>
      <dc:creator>proctors</dc:creator>
      <dc:date>2017-07-14T12:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date Difference Between Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307661#M826800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Try aggr &lt;STRONG style="font-size: 11.7px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A href="https://community.qlik.com/people/ahaahaaha"&gt;ahaahaaha&lt;/A&gt;&lt;/STRONG&gt; reply&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Min(Agrr( Min ({&amp;lt;[Encounter Type]={'TELEPHONE'}&amp;gt;}Date), ID))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 13:14:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307661#M826800</guid>
      <dc:creator>vvvvvvizard</dc:creator>
      <dc:date>2017-07-14T13:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Date Difference Between Rows</title>
      <link>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307662#M826801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry, what expression is this replacing above? Seems to be returning the ID and not the corrected date difference.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jul 2017 14:23:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculating-Date-Difference-Between-Rows/m-p/1307662#M826801</guid>
      <dc:creator>proctors</dc:creator>
      <dc:date>2017-07-14T14:23:40Z</dc:date>
    </item>
  </channel>
</rss>

