<?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: Wrong result when comparing two numbers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217348#M861376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To tell you the truth, I don't know what it's doing. May be someone else can guide us here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Jan 2017 18:32:15 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2017-01-09T18:32:15Z</dc:date>
    <item>
      <title>Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217343#M861371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm quite new to qlikview and I have a strange result in my script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to compare two numbers in an "if" statement but I don't go inside the condition even if the condition seems true :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My first variable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempMaxDate:&lt;/P&gt;&lt;P&gt;&amp;nbsp; LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Max (_comptaTimeStamp)as MaxDate &lt;/P&gt;&lt;P&gt;&amp;nbsp; from $(vQVDPath)DATA_COMPTA.qvd (qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; Let vMaxQVDdate = Peek('MaxDate',0,'TempMaxDate');&lt;/P&gt;&lt;P&gt;&amp;nbsp; Drop table TempMaxDate;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My second variable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vFileDate = num(date#(FileTime('$(file)'),'DD/MM/YYYY hh:mm:ss[.fff]'));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I debug my code I get&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screenshot.10.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148841_screenshot.10.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screenshot.11.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/148842_screenshot.11.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I don't enter in the if statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&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/Wrong-result-when-comparing-two-numbers/m-p/1217343#M861371</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217344#M861372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does this make any difference (not adding Num() function)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If $(vFileDate) &amp;gt; $(vMaxQVDDate) then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 17:31:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217344#M861372</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-01-09T17:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217345#M861373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get this message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="screenshot.12.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/148851_screenshot.12.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 17:35:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217345#M861373</guid>
      <dc:creator />
      <dc:date>2017-01-09T17:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217346#M861374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this? Putting the expression within single quotes &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&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;If '$(vFileDate)' &amp;gt; '$(vMaxQVDDate)' then&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 17:49:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217346#M861374</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-01-09T17:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217347#M861375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It worked, thank you very much Sunny, Even if I don't understand why my first try was wrong ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I understand I'm comparing two strings with your method ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 17:55:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217347#M861375</guid>
      <dc:creator />
      <dc:date>2017-01-09T17:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217348#M861376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To tell you the truth, I don't know what it's doing. May be someone else can guide us here &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 18:32:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217348#M861376</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-01-09T18:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217349#M861377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;IF &lt;/EM&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;EM&gt;&lt;STRONG&gt;vFileDate&lt;/STRONG&gt; &amp;gt; &lt;STRONG&gt;vMaxQVDDate&lt;/STRONG&gt; THEN&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMHO, using dollar sign expansion just adds potential issues with number literal formatting here (e.g. decimal separator needs to be a point for a constant number used in the script or expression). And using an implicit string interpretation / string comparison doesn't make it easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should then also be enough to use&lt;/P&gt;&lt;P&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;EM&gt;Let vFileDate = FileTime('$(file)');&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Jan 2017 23:07:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217349#M861377</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-01-09T23:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong result when comparing two numbers</title>
      <link>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217350#M861378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Stefan and thank you for your answer, you're right !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I removed the $ and everything is ok even with &lt;EM style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;Let vFileDate = FileTime('$(file)');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank' again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 08:47:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Wrong-result-when-comparing-two-numbers/m-p/1217350#M861378</guid>
      <dc:creator />
      <dc:date>2017-01-10T08:47:11Z</dc:date>
    </item>
  </channel>
</rss>

