<?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: Diff between two timestamps expressed as an SLA in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851607#M70347</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Oct 2021 04:38:54 GMT</pubDate>
    <dc:creator>QFanatic</dc:creator>
    <dc:date>2021-10-26T04:38:54Z</dc:date>
    <item>
      <title>Diff between two timestamps expressed as an SLA</title>
      <link>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851338#M70326</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have 2 timestamps ..a CloseTime...2021/08/25 11:35:24, and an OpenTime...2021/08/20 10:07:47.&lt;/P&gt;
&lt;P&gt;I subtract these in script and I get a time difference of 51:04:44 which is correct by using&amp;nbsp; interval(DTTM_REQUEST_CLOSE - DTTM_ASSIGNED_DATE,'hh') .&lt;/P&gt;
&lt;P&gt;now I want to compare that difference to 24 hours - if it is more I want to flag SLA_Breached as 'Yes'.&lt;/P&gt;
&lt;P&gt;I have tried every variation I can think of, but to no luck...&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;if(Timestamp#(DTTM_REQUEST_CLOSE) - Timestamp#(DTTM_ASSIGNED_DATE) &amp;gt; maketime(24), 'Y','N') as SLA_BREACHED&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp;if(hour(interval(DTTM_REQUEST_CLOSE - DTTM_ASSIGNED_DATE)) &amp;gt; 24, 'Y','N')&amp;nbsp;&lt;/P&gt;
&lt;P&gt;None of them work. Any idea how I can do this comparison?&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 13:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851338#M70326</guid>
      <dc:creator>QFanatic</dc:creator>
      <dc:date>2021-10-25T13:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between two timestamps expressed as an SLA</title>
      <link>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851352#M70329</link>
      <description>&lt;P&gt;24h are one day. So you could just check, wether the difference is &amp;gt;1 :&lt;/P&gt;
&lt;P&gt;if(Timestamp#(DTTM_REQUEST_CLOSE) - Timestamp#(DTTM_ASSIGNED_DATE) &amp;gt; 1, 'Y','N') as SLA_BREACHED&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 14:45:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851352#M70329</guid>
      <dc:creator>ManuelRühl</dc:creator>
      <dc:date>2021-10-25T14:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between two timestamps expressed as an SLA</title>
      <link>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851361#M70330</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Load *,
	if(SubField(interval(DTTM_REQUEST_CLOSE - DTTM_ASSIGNED_DATE),':',1)&amp;gt;24,'Y','N') as SLA_BREACHED;
load 
	Timestamp(Timestamp#(DTTM_ASSIGNED_DATE,'YYYY/MM/DD hh:mm:ss')) as DTTM_ASSIGNED_DATE,
    Timestamp(Timestamp#(DTTM_REQUEST_CLOSE,'YYYY/MM/DD hh:mm:ss')) as DTTM_REQUEST_CLOSE
inline [
DTTM_ASSIGNED_DATE,DTTM_REQUEST_CLOSE
2021/08/20 10:07:47,2021/08/25 11:35:24
];
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2021-10-25 16_31_35-test - Il mio nuovo foglio (24) _ Foglio - Qlik Sense.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/65156i48A9E183B6EF128B/image-size/large?v=v2&amp;amp;px=999" role="button" title="2021-10-25 16_31_35-test - Il mio nuovo foglio (24) _ Foglio - Qlik Sense.png" alt="2021-10-25 16_31_35-test - Il mio nuovo foglio (24) _ Foglio - Qlik Sense.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 14:32:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851361#M70330</guid>
      <dc:creator>micheledenardi</dc:creator>
      <dc:date>2021-10-25T14:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Diff between two timestamps expressed as an SLA</title>
      <link>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851607#M70347</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 04:38:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Diff-between-two-timestamps-expressed-as-an-SLA/m-p/1851607#M70347</guid>
      <dc:creator>QFanatic</dc:creator>
      <dc:date>2021-10-26T04:38:54Z</dc:date>
    </item>
  </channel>
</rss>

