<?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: date compare calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031222#M348147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your sample number for a timestamp returns 0706//2009 10:00:00 on my system, but basically, I think you should be fine with something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( If( Fabs(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;APPT_DTTM - APPT_CANC_DTTM) &amp;lt;= 1,1,0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then divide by the number of appointments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2016 21:21:52 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-03-31T21:21:52Z</dc:date>
    <item>
      <title>date compare calculation</title>
      <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031221#M348146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&amp;nbsp; I'm looking for help in comparing the difference between two date fields to a third, static number.&amp;nbsp; I have two fields (APPT_DTTM and APPT_CANC_DTTM) that I need to find the difference between, then take that difference and compare it to a static number (24 hours).&amp;nbsp; What would be the best way to go about this?&amp;nbsp; The APPT_DTTM and APPT_CANC_DTTM fields are in the same format (example: 7/6/2009 9:28:44 AM shows as 40000.416666667 without a Timestamp conversion).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to do is show the percentage of appointments that have been cancelled within 24 hours (APPT_CANC_DTTM) of the scheduled appointment time (APPT_DTTM).&amp;nbsp; To do this I think I would need to find the difference between the two times, compare that difference to 24 hours, and return a "1" if the difference is within 24 hours of the scheduled appointment time and a "0" if it is outside of 24 hours of the scheduled appointment time.&amp;nbsp; I can then sum all the "1"'s and divide that by the total number of appointments to get my percentage; this part I can do, it's just getting those "1"'s I can't figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help you can provide would be HUGELY appreciated!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 20:01:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031221#M348146</guid>
      <dc:creator>mdurso26</dc:creator>
      <dc:date>2016-03-31T20:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: date compare calculation</title>
      <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031222#M348147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your sample number for a timestamp returns 0706//2009 10:00:00 on my system, but basically, I think you should be fine with something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( If( Fabs(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;APPT_DTTM - APPT_CANC_DTTM) &amp;lt;= 1,1,0))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then divide by the number of appointments.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:21:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031222#M348147</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-03-31T21:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: date compare calculation</title>
      <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031223#M348148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for time difference maybe you can use&amp;nbsp; the "&lt;STRONG&gt;-"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1 is 24 hours = 1 day &lt;/P&gt;&lt;P&gt;if time difference &amp;gt;=1 then 1 else 0&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if((&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;APPT_DTTM &lt;/SPAN&gt;- &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;APPT_CANC_DTTM &lt;/SPAN&gt;)&amp;gt;=1, 1, 0)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:30:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031223#M348148</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2016-03-31T21:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: date compare calculation</title>
      <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031224#M348149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;maybe&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;-(APPT_DTTM-APPT_CANC_DTTM&amp;lt;=1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;or &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sign(Floor(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;APPT_DTTM-APPT_CANC_DTTM&lt;/SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;(provided always &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;AP&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;PT_DTTM&amp;gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;APPT_CANC_DTTM)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Marco&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 23:52:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031224#M348149</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-03-31T23:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: date compare calculation</title>
      <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031225#M348150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply!&amp;nbsp; I need to do the comparison part to other times in addition to 24 hours.&amp;nbsp; I'm looking to compare the difference to 24 hours, 16 hours, 12 hours, 8 hours, 4 hours, 2 hours, and 1 hour within the scheduled appointment time.&amp;nbsp; Would I do that like below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;24 hours&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=1, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;16 hours&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=0.6667, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12 hours&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=0.5, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8 hours&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=0.3334, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4 hours&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=0.1667, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 hours&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=0.0833, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 hour&lt;/P&gt;&lt;P&gt;if((APPT_DTTM - APPT_CANC_DTTM )&amp;gt;=0.0416, 1, 0)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2016 17:33:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031225#M348150</guid>
      <dc:creator>mdurso26</dc:creator>
      <dc:date>2016-04-01T17:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: date compare calculation</title>
      <link>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031226#M348151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactely, the fractional part of a timestamp or time interval is stating part of a day, i.e. part of 24 hours.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;12 hours = 12/24 = 1/2&lt;/P&gt;&lt;P&gt;2 hours = 2/24 = 1/12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: And remember to use aggregation functions if you need to aggregate multiple records, e.g. in a chart expression or text box.&lt;/P&gt;&lt;P&gt;Like the suggested&lt;EM&gt; Sum(If( ....))&lt;/EM&gt; above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2016 17:40:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/date-compare-calculation/m-p/1031226#M348151</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-04-01T17:40:10Z</dc:date>
    </item>
  </channel>
</rss>

