<?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 with round in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332128#M122369</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;There is a problem with Round and Floor, both not working as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See Support case 00170986 &amp;amp; 00170987.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could write a little trick but of course have other problems behind!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Apr 2013 14:30:38 GMT</pubDate>
    <dc:creator>Joaquin_Lazaro</dc:creator>
    <dc:date>2013-04-19T14:30:38Z</dc:date>
    <item>
      <title>Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332120#M122361</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;I have the following problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a field PRICE with "0,285" and I want to round it into "0,29"&lt;/P&gt;&lt;P&gt;So I take round(PRICE, '0,01') but the result is "0,28".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the problem??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 12:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332120#M122361</guid>
      <dc:creator>wunderch</dc:creator>
      <dc:date>2012-08-01T12:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332121#M122362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about the ceil() function?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Bold"&gt;EG. ceil( 3.88 , 0.1 ) &lt;/SPAN&gt;returns 3.9&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 12:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332121#M122362</guid>
      <dc:creator />
      <dc:date>2012-08-01T12:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332122#M122363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;=round(0.285, 0.01)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;results in 0.29 on my side. Are you really using a string (note the single quotes) as second argument? I don't think that works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 12:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332122#M122363</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-01T12:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332123#M122364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, when I take a textbox with formula &lt;/P&gt;&lt;P&gt;=round(0.285, 0.01)&lt;/P&gt;&lt;P&gt;then I get 0,29&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I take the formula in the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; round(PRICE, 0.01) as PRICE, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get 0,28&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 12:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332123#M122364</guid>
      <dc:creator>wunderch</dc:creator>
      <dc:date>2012-08-01T12:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332124#M122365</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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =Ceil(PRICE,0.01) gives 0.29&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 13:14:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332124#M122365</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-08-01T13:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332125#M122366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your answers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but my problem was that the field "PRICE" have many prices and that prices I want to round commercially, so I can't take ceil()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have found the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First I made round(PRICE, 0.001) as PRICE and then again round(PRICE, 0.01) as PRICE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I get 0,29 for 0,285.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 13:21:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332125#M122366</guid>
      <dc:creator>wunderch</dc:creator>
      <dc:date>2012-08-01T13:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332126#M122367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That seems to work for 0.285, but I got the same issue with other floating points, like 0.295&lt;/P&gt;&lt;P&gt;I assume that's due to floating point representation issue in QV (though I think it's strange that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD *, round(Price,0.01) as test1, round(0.285,0.01) as test2&lt;/P&gt;&lt;P&gt; INLINE [&lt;/P&gt;&lt;P&gt;Price&lt;/P&gt;&lt;P&gt;0.285&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;returns different values for test1 and test2).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this should work for all numbers (at least with my test data, it works):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;num(round(Price*1000,10)/1000,'#.00') as PriceRounded&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 13:51:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332126#M122367</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-01T13:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332127#M122368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have same problem and it seems that Qlikview doesn’t manage periodic number correctly in rounding and in some others operations.&lt;/P&gt;&lt;P&gt;When the result of a division is a periodic number, Qlik does not recognize it as periodic. Probably the result of your division is a number like 0.2849999999.. (9 periodic) that in math is the same of 0,285. Computer cannot store&amp;nbsp; periodic number and so the number is saved like 0.2849999999998. QV doesn’t&amp;nbsp; see this number as periodic and so the round(0.001) is “correctly” 0.28 because it is &amp;lt; 0.285. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another examples is&amp;nbsp; fmod(1,0.003) =0,00099999999999998. It should be 0.00099999..=0.001.&lt;/P&gt;&lt;P&gt;fmod(1,0.03) =0,01 works well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don’t know if it is a bug or not ,but often you can fix it using two round functions such as round(round(a,0.000001),0.01).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 14:18:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332127#M122368</guid>
      <dc:creator>mauro_villa</dc:creator>
      <dc:date>2012-12-12T14:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with round</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332128#M122369</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;There is a problem with Round and Floor, both not working as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See Support case 00170986 &amp;amp; 00170987.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could write a little trick but of course have other problems behind!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Apr 2013 14:30:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-round/m-p/332128#M122369</guid>
      <dc:creator>Joaquin_Lazaro</dc:creator>
      <dc:date>2013-04-19T14:30:38Z</dc:date>
    </item>
  </channel>
</rss>

