<?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: problem at Decimal Comparison in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411950#M153374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try by loading&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;text(field) as field;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might funny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change your expression IF(A &amp;gt;= '0.15' 'True', 'False') &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2012 10:19:29 GMT</pubDate>
    <dc:creator>sivarajs</dc:creator>
    <dc:date>2012-12-06T10:19:29Z</dc:date>
    <item>
      <title>problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411949#M153373</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;I came across a surprising situation during decimal values comparision, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example I have executed the below inline statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.15&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I created the a text box with definition: &lt;/P&gt;&lt;P&gt;=IF(A &amp;gt;= 0.15, 'True', 'False')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to my surprise the result I can see in the text box is 'False'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried using the Num function but not much of use, I am using QV9 SR6. Has any body faced this earlier? any known resolution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 10:07:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411949#M153373</guid>
      <dc:creator />
      <dc:date>2012-12-06T10:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411950#M153374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try by loading&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load &lt;/P&gt;&lt;P&gt;text(field) as field;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might funny&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change your expression IF(A &amp;gt;= '0.15' 'True', 'False') &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 10:19:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411950#M153374</guid>
      <dc:creator>sivarajs</dc:creator>
      <dc:date>2012-12-06T10:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411951#M153375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmmm, this really sounds like a bug or very inconsistent behaviour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you load the following ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NumTest:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; A&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 15&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... then create this expression &lt;STRONG&gt;=if((A/100)&amp;gt;=0.15,'True','False') &lt;/STRONG&gt;it also evaluates to False, which is clearly incorrect. As Sivaraj has noted, you can wrap quotes around the value to force it to calculate correctly.&amp;nbsp; However, if you develop an application using integers, such as &lt;STRONG&gt;=if(A&amp;gt;=15,'True','False')&lt;/STRONG&gt;, this does NOT require the quotes, so if decimals are introduced later, there will be errors introduced.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using QV11 SR1, so no changes in functionality since QV9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would log a call with QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 11:26:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411951#M153375</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-12-06T11:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411952#M153376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try...with 0.15 (dot), not 0,15 (comma)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;A&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &amp;gt;= 0.15, 'True', 'False') &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Rebeca&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 11:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411952#M153376</guid>
      <dc:creator />
      <dc:date>2012-12-06T11:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411953#M153377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The OP already used a dot, however I wonder if this is how the anomaly arose.&amp;nbsp; In Sweden (according to Wikipedia) the decimal separator is a comma, and so you would HAVE to wrap the value in quotes otherwise the statement would fail due to the decimal part becoming the TRUE evaluation part of the IF.&amp;nbsp; Here in the UK we use a dot and this doesn't fail the statement if you don't use quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;flipside&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 11:53:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411953#M153377</guid>
      <dc:creator>flipside</dc:creator>
      <dc:date>2012-12-06T11:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411954#M153378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, so putting quotes around the decimal fixes it, but if the result isn't a decimal then internally it is working correctly. i.e.; If you do something like: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(num(A)*100 = 15, 'Correct', 'Incorrect') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(with num(A) being 0.15) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it works fine, so you don't need to accomodate for the decimal unless putting it in your if clause. I think that as long as you are writing a decimal anywhere you remember to quote it, it should be ok? Are there any circumstances where this would be a problem though?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 11:56:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411954#M153378</guid>
      <dc:creator>richnorris</dc:creator>
      <dc:date>2012-12-06T11:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411955#M153379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if(A&amp;gt;=0.14999999999999999,'True','False') - will return False for A=0.15&lt;/P&gt;&lt;P&gt;if(A&amp;gt;=0.1499999999999999,'True','False') - will return True for A=0.15&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that gives us the cutoff for how QlikView floats decimals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Curiously,&lt;/P&gt;&lt;P&gt;if(A&amp;gt;=round(0.15,0.01),'True','False') will return True for A=0.15, so I guess it does have the ability to handle correctly. You can use that if you don't want to use the string version, I suppose. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 12:17:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411955#M153379</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2012-12-06T12:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411956#M153380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;orsh_ is spot on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should never test real numbers for equality. Most decimal numbers cannot be represented correctly in a binary form, so &lt;STRONG&gt;&lt;EM&gt;an equality test is meaningless&lt;/EM&gt;&lt;/STRONG&gt;. There is a lot written about this, e.g. &lt;A class="loading" href="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm" title="http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm"&gt;http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this specific case, you have a comparison inside the if-function [A&amp;gt;=0.15]. The expression left of the relational operator goes through an aggregation step (there may exist several values of A) that the right side does not have. I suspect that this step causes the difference between the left and the right side of the comparison.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 14:47:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411956#M153380</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-12-06T14:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: problem at Decimal Comparison</title>
      <link>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411957#M153381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Orsh_ !&lt;/P&gt;&lt;P&gt;that resolved the problem, Nice anology!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Dec 2012 10:19:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/problem-at-Decimal-Comparison/m-p/411957#M153381</guid>
      <dc:creator />
      <dc:date>2012-12-11T10:19:41Z</dc:date>
    </item>
  </channel>
</rss>

