<?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: Compare times in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-times/m-p/1271451#M865203</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is truly read as times by QlikView, you might not even need Time() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(FinishTime &amp;lt; SLA, 1, 0) as Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it seems they are not read as time, so try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Time#(FinishTime, 'h:mm:ss') &amp;lt; Time#(SLA, 'h:mm:ss'), 1, 0) as Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Dec 2016 20:31:58 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-12-15T20:31:58Z</dc:date>
    <item>
      <title>Compare times</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-times/m-p/1271450#M865202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;trying to compare two times and seem to get wrong results&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression: if(time(FinishTime) &amp;lt;&amp;nbsp; time(SLA),1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;time format used HH:MM:SS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example: finish time is 5:10:59&lt;/P&gt;&lt;P&gt;SLA: 7:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here I should get 1 but getting 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone knows why?&lt;/P&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/Compare-times/m-p/1271450#M865202</guid>
      <dc:creator>alec1982</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Compare times</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-times/m-p/1271451#M865203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If it is truly read as times by QlikView, you might not even need Time() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(FinishTime &amp;lt; SLA, 1, 0) as Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it seems they are not read as time, so try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Time#(FinishTime, 'h:mm:ss') &amp;lt; Time#(SLA, 'h:mm:ss'), 1, 0) as Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 20:31:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-times/m-p/1271451#M865203</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-12-15T20:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare times</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-times/m-p/1271452#M865204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess your FinishTime and SLA fields are timestamps, i.e. they have an integer date part you have to get rid of to just compare the fractional time part of the timestamp. (The &lt;A href="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/FormattingFunctions/formatting-functions.htm" title="http://help.qlik.com/en-US/qlikview/12.0/Subsystems/Client/Content/Scripting/FormattingFunctions/formatting-functions.htm"&gt;Time()&lt;/A&gt; function you used doesn't change the numerical value of your timestamp, it only formats it.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So one solution might be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14818421417307471" jivemacro_uid="_14818421417307471"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;If(Frac(FinishTime) &amp;lt;&amp;nbsp; Frac(SLA),1,0)&lt;/SPAN&gt;&lt;/PRE&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 shorter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14818423822389136 jive_text_macro" jivemacro_uid="_14818423822389136"&gt;
&lt;P&gt;-(Frac(FinishTime) &amp;lt;&amp;nbsp; Frac(SLA))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;as boolean true has a value of -1 while false is represented by 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;hope this helps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Marco&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 22:48:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-times/m-p/1271452#M865204</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2016-12-15T22:48:30Z</dc:date>
    </item>
  </channel>
</rss>

