<?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: Qlik decimal issue in Management &amp; Governance</title>
    <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016662#M23950</link>
    <description>&lt;P&gt;It's&amp;nbsp;const=fract but, before then, Num#(RecNo()/10,'#,#') as fract&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2022 15:49:08 GMT</pubDate>
    <dc:creator>Mark_Winter</dc:creator>
    <dc:date>2022-12-14T15:49:08Z</dc:date>
    <item>
      <title>Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016582#M23941</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;We have a problem on QlikSense. We tried to do this equality: 0.3=3/10 and we got a false result. We got the same result for 0.6 and 0.9 too, as you can see in the attached file. This can be a problem for kpi that use this numbers. Morever the constant value is less than fract value. The script that we wrote is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Num#('0,'&amp;amp;RecNo(),'#,#') as const,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Num(RecNo()/10,'#,#') as fract&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AutoGenerate 9;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But we tried to replicate the same issue in frontend without fields only doing: 0.3=3/10.&amp;nbsp; What can we do?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 14:11:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016582#M23941</guid>
      <dc:creator>giuseppedicosmo</dc:creator>
      <dc:date>2022-12-14T14:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016612#M23942</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;
&lt;P&gt;Like this?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Mark_Winter_0-1671029957977.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/96240iC35F6BDC4CEFAFC9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Mark_Winter_0-1671029957977.png" alt="Mark_Winter_0-1671029957977.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 15:00:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016612#M23942</guid>
      <dc:creator>Mark_Winter</dc:creator>
      <dc:date>2022-12-14T15:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016613#M23943</link>
      <description>&lt;P&gt;Yes, but i have false for 0.3,0.6 and 0.9. Can i see the formule that do you use for the equality? For me is 0.3=3/10 or const=fract&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 15:04:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016613#M23943</guid>
      <dc:creator>giuseppedicosmo</dc:creator>
      <dc:date>2022-12-14T15:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016662#M23950</link>
      <description>&lt;P&gt;It's&amp;nbsp;const=fract but, before then, Num#(RecNo()/10,'#,#') as fract&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 15:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016662#M23950</guid>
      <dc:creator>Mark_Winter</dc:creator>
      <dc:date>2022-12-14T15:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016668#M23951</link>
      <description>&lt;P&gt;Hi Mark,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;But if you use num# you force the argument to be a string. I need to understand why 0.3 as string is different from 3/10, but this doesn't happen for 0.2,0.1 etc. The problem is that i have a sum of a field that is 0.1+0.1+0.1 and this is different from 3/10. This is very strange, because if i do sum(field)=0.3 i got false, even if the sum is 0.3!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:01:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016668#M23951</guid>
      <dc:creator>giuseppedicosmo</dc:creator>
      <dc:date>2022-12-14T16:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016684#M23952</link>
      <description>&lt;P&gt;Perhaps this will shed some light on the problem:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Design/Rounding-Errors/ba-p/1468808" target="_blank"&gt;https://community.qlik.com/t5/Design/Rounding-Errors/ba-p/1468808&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:28:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016684#M23952</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2022-12-14T16:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016695#M23953</link>
      <description>&lt;P&gt;You should be very careful when you use equality as condition for floats. Read Or's link above, and you'll understand.&lt;/P&gt;&lt;P&gt;Internally in the Qlik engine we now (introduced after the above blog post) have an algorithm that tries to evaluate if the two numbers are "close enough" and if so, return TRUE. But if we were to be strict, comparing two floats would almost always result in FALSE.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2022 16:50:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016695#M23953</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-12-14T16:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016893#M23955</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/6622"&gt;@hic&lt;/a&gt;&amp;nbsp;, the article is very good! Now it's all clear, but why do i have that the fixed number is less than fract number? How is it possible? Because you say that this is a problem on equality, but i have problems on disequality too. And if i need to set an equality for a project, what can i do for workaround this issue?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2022 09:02:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016893#M23955</guid>
      <dc:creator>giuseppedicosmo</dc:creator>
      <dc:date>2022-12-15T09:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Qlik decimal issue</title>
      <link>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016929#M23957</link>
      <description>&lt;P&gt;There are two good work-arounds:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Convert it to integers: If you for example know that you always work with tenths (1/10) then you can test&lt;BR /&gt;Round(10*const)=Round(10*frac)&lt;/LI&gt;&lt;LI&gt;Determine a "close enough"-distance: If you assume that a difference of 0.000001 is close enough, then you can do the test as&lt;BR /&gt;fAbs(const-frac)&amp;lt;=0.000001&lt;BR /&gt;or if you want relative difference, you could use the following test:&lt;BR /&gt;fAbs(const-frac)/RangeMax(fAbs(const),fAbs(frac))&amp;lt;=0.000001&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Thu, 15 Dec 2022 09:51:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Management-Governance/Qlik-decimal-issue/m-p/2016929#M23957</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2022-12-15T09:51:31Z</dc:date>
    </item>
  </channel>
</rss>

