<?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 calculating difference in DateTimes from two different sources in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/calculating-difference-in-DateTimes-from-two-different-sources/m-p/1442354#M432665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to calculate the number of minutes between two times that may be on different days. So if one is 23:30 last night, and the other is 1:30 this morning, the calculation's result needs to be: 120 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;ADDRESS&gt;I am getting one DateTime value from SQL Server (&lt;SPAN style="font-size: 13.3333px;"&gt;YYYY/MM/DD hh:ss) &lt;/SPAN&gt;and one from Excel.&lt;/ADDRESS&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a way to do one of the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Tell Excel to format the DateTime as YYYY/MM/DD hh:ss (I recognize this is beyond the scope of this forum).&lt;/LI&gt;&lt;LI&gt;Tell QlikView to convert the DateTime in Excel (MM/DD/YYYY hh:ss) to &lt;SPAN style="font-size: 13.3333px;"&gt;Y&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;YYY&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-style: italic;"&gt;/&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;MM/DD hh:ss, so that it matches all the other date times in the .qvw.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Set Analysis that calculates the difference between one date and time and another date and time (s&lt;SPAN style="font-size: 13.3333px;"&gt;o if one is 23:30 last night, and the other is 1:30 this morning, the calculation's result needs to be: 120 minutes).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Sep 2017 15:45:46 GMT</pubDate>
    <dc:creator>Margaret</dc:creator>
    <dc:date>2017-09-29T15:45:46Z</dc:date>
    <item>
      <title>calculating difference in DateTimes from two different sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-difference-in-DateTimes-from-two-different-sources/m-p/1442354#M432665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to calculate the number of minutes between two times that may be on different days. So if one is 23:30 last night, and the other is 1:30 this morning, the calculation's result needs to be: 120 minutes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;ADDRESS&gt;I am getting one DateTime value from SQL Server (&lt;SPAN style="font-size: 13.3333px;"&gt;YYYY/MM/DD hh:ss) &lt;/SPAN&gt;and one from Excel.&lt;/ADDRESS&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a way to do one of the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Tell Excel to format the DateTime as YYYY/MM/DD hh:ss (I recognize this is beyond the scope of this forum).&lt;/LI&gt;&lt;LI&gt;Tell QlikView to convert the DateTime in Excel (MM/DD/YYYY hh:ss) to &lt;SPAN style="font-size: 13.3333px;"&gt;Y&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;YYY&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px; font-style: italic;"&gt;/&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;MM/DD hh:ss, so that it matches all the other date times in the .qvw.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Set Analysis that calculates the difference between one date and time and another date and time (s&lt;SPAN style="font-size: 13.3333px;"&gt;o if one is 23:30 last night, and the other is 1:30 this morning, the calculation's result needs to be: 120 minutes).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 15:45:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-difference-in-DateTimes-from-two-different-sources/m-p/1442354#M432665</guid>
      <dc:creator>Margaret</dc:creator>
      <dc:date>2017-09-29T15:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: calculating difference in DateTimes from two different sources</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-difference-in-DateTimes-from-two-different-sources/m-p/1442355#M432666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Margaret, Timestamp# can be used to convert date formats, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Timestamp&lt;/SPAN&gt;#(FieldInOtherFormat, 'MM/DD/YYYY hh:mm') // returns the timestamp in the document format&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the difference in minutes you can substrat one date to another and multiply the result by 1440 (minutes in a day):&lt;/P&gt;&lt;P&gt;(EndDateTime-StartDateTime) * 1440 as MinutesDifference&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Sep 2017 16:08:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-difference-in-DateTimes-from-two-different-sources/m-p/1442355#M432666</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2017-09-29T16:08:09Z</dc:date>
    </item>
  </channel>
</rss>

