<?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: variable with negative numbers comparision in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577334#M214731</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have create similar function in my PC and working fine. Can you please upload your sample data file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Apr 2014 19:07:02 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2014-04-29T19:07:02Z</dc:date>
    <item>
      <title>variable with negative numbers comparision</title>
      <link>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577333#M214730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have a variable which is defined as follows&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;vTimeDiff = Interval(&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;[Deliver By Time]&lt;/SPAN&gt;- &lt;SPAN style="color: #800000;"&gt;[Delivered Time],'mm'&lt;/SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;This gives me the time interval in minutes between the two dates as -1094&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;If I use this in an if statement and compare to a negative value I get wrong results&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;$(vTimeDiff)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;lt; -120,1,0)&amp;nbsp; returns a result = 0, should retuirn 1 since -1094 &amp;lt; -120&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;When I hardcode the value of the variable to -1094 rather than the interval function&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The if statement evaluates correctly&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;vTimeDiff = -1094&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;example&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: #0000ff;"&gt;if&lt;/SPAN&gt;(&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;$(vTimeDiff)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; &amp;lt; -120,1,0)&amp;nbsp; returns a result = 1, which is correct &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Would appreciate any help on this matter ?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 18:52:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577333#M214730</guid>
      <dc:creator />
      <dc:date>2014-04-29T18:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: variable with negative numbers comparision</title>
      <link>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577334#M214731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have create similar function in my PC and working fine. Can you please upload your sample data file?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 19:07:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577334#M214731</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-29T19:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: variable with negative numbers comparision</title>
      <link>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577335#M214732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi interval returns time number&lt;/P&gt;&lt;P&gt;so the display shows -1094&lt;/P&gt;&lt;P&gt;bu actually it around 18 hours which translate to around 0.75 in numeric values&lt;/P&gt;&lt;P&gt;if you want to translate it to numeric minutes&lt;/P&gt;&lt;P&gt;just use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;vTimeDiff = Interval(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;[Deliver By Time]&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;- &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;[Delivered Time],'mm'&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)*1440&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 19:11:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577335#M214732</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2014-04-29T19:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: variable with negative numbers comparision</title>
      <link>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577336#M214733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Liron, that works perfectly&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 13:44:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/variable-with-negative-numbers-comparision/m-p/577336#M214733</guid>
      <dc:creator />
      <dc:date>2014-05-02T13:44:33Z</dc:date>
    </item>
  </channel>
</rss>

