<?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 Finding Difference in Date across rows in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762714#M1042542</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So say there are 5 Patients and one of the Patients came in to the office today (12/02/2014) and they also came in previously less than 30 days ago. How would I display this one patient that matches the criteria in a chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD PatientID, date(AppDate,'MM/DD/YYYY') as AppDate INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PatientID, AppDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 12/02/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 11/22/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 01/01/2014&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any thoughts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Dec 2014 22:24:58 GMT</pubDate>
    <dc:creator>mellerbeck</dc:creator>
    <dc:date>2014-12-02T22:24:58Z</dc:date>
    <item>
      <title>Finding Difference in Date across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762714#M1042542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So say there are 5 Patients and one of the Patients came in to the office today (12/02/2014) and they also came in previously less than 30 days ago. How would I display this one patient that matches the criteria in a chart?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD PatientID, date(AppDate,'MM/DD/YYYY') as AppDate INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PatientID, AppDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 12/02/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 11/22/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 01/01/2014&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for any thoughts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 22:24:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762714#M1042542</guid>
      <dc:creator>mellerbeck</dc:creator>
      <dc:date>2014-12-02T22:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Difference in Date across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762715#M1042543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Michael,&lt;/P&gt;&lt;P&gt;you can use a floor function to get the difference between the dates and use today() for latest date below is the script:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;TEST:&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;PatientID&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;date&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;AppDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,'MM/DD/YYYY') &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;AppDate&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;INLINE&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;[&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PatientID, AppDate&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 12/02/2014&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 11/22/2014&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 01/01/2014&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 01/01/2014&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 01/01/2014&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 01/01/2014&lt;BR /&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;;&lt;BR /&gt;&lt;BR /&gt;NEW:&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;PatientID&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;AppDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;,&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;FLOOR&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;TODAY&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;()-&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;AppDate&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;AS&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: maroon; font-size: 9pt;"&gt;DIFF_daYS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;RESIDENT&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; TEST;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then use &lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; {&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;DIFF_daYS&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;={'&amp;lt;30'}&amp;gt;}&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;PatientID&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;) for any chart to build as htis will give patient which visited less than 30 days.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 22:59:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762715#M1042543</guid>
      <dc:creator>saurabh5</dc:creator>
      <dc:date>2014-12-02T22:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Difference in Date across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762716#M1042544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm maybe the max date minus the max date of rank 2 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 23:00:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762716#M1042544</guid>
      <dc:creator>mellerbeck</dc:creator>
      <dc:date>2014-12-02T23:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Difference in Date across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762717#M1042545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Test:&lt;/P&gt;&lt;P&gt;LOAD PatientID, date(AppDate,'MM/DD/YYYY') as AppDate INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PatientID, AppDate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 12/02/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 11/22/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 01/01/2014&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 01/01/2014&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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(PatientID = Previous(PatientID) and Interval(AppDate - Previous(AppDate))&amp;lt;=30,'Yes','No') as ThirtyDaysVisitFlag&lt;/P&gt;&lt;P&gt;Resident Test&lt;/P&gt;&lt;P&gt;Order By PatientID, AppDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Test;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 23:39:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762717#M1042545</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-12-02T23:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Finding Difference in Date across rows</title>
      <link>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762718#M1042546</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;one solution to calculate the days since previous visit in the script could be:&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_14175662823021549" jivemacro_uid="_14175662823021549"&gt;
&lt;P&gt;// Test Data Generation&lt;/P&gt;
&lt;P&gt;tabPatAppDat:&lt;/P&gt;
&lt;P&gt;LOAD Ceil(Rand()*100) as PatientID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DayName(YearStart(Today())+Rand()*(DayNumberOfYear(Today()))) as AppDate&lt;/P&gt;
&lt;P&gt;AutoGenerate 400;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;// adding DaysSinceLastVisit field&lt;/P&gt;
&lt;P&gt;Left Join (tabPatAppDat)&lt;/P&gt;
&lt;P&gt;LOAD PatientID,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppDate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(PatientID=Previous(PatientID),AppDate-Previous(AppDate)) as DaysSinceLastVisit&lt;/P&gt;
&lt;P&gt;Resident tabPatAppDat&lt;/P&gt;
&lt;P&gt;Order By PatientID, AppDate;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Dec 2014 00:25:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Finding-Difference-in-Date-across-rows/m-p/762718#M1042546</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-12-03T00:25:55Z</dc:date>
    </item>
  </channel>
</rss>

