<?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 Rounding error in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171266#M41333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dunno why but doing this:&lt;/P&gt;&lt;P&gt;round(round(1.265,0.001), 0.01)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;results in 1.27!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2009 21:47:44 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-01T21:47:44Z</dc:date>
    <item>
      <title>Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171265#M41332</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;in the attached Application you can see an analysis of the rounding error in QilikView. I've listed the numbers from 1 to 99 with 3 digits rounded to 2 digits. I've calculated the right result with a formula and added a comparison flag called R_Fehler.&lt;/P&gt;&lt;P&gt;The surprising point is, that there are nuber ranges with no errors (see 41 - 52).&lt;/P&gt;&lt;P&gt;What do you think, could this error be solved? Or do we have to live with it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Alex:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 21:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171265#M41332</guid>
      <dc:creator />
      <dc:date>2009-12-01T21:23:04Z</dc:date>
    </item>
    <item>
      <title>Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171266#M41333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dunno why but doing this:&lt;/P&gt;&lt;P&gt;round(round(1.265,0.001), 0.01)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;results in 1.27!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 21:47:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171266#M41333</guid>
      <dc:creator />
      <dc:date>2009-12-01T21:47:44Z</dc:date>
    </item>
    <item>
      <title>Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171267#M41334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or =round(1.265,0.01,5)&lt;/P&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 21:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171267#M41334</guid>
      <dc:creator />
      <dc:date>2009-12-01T21:50:47Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171268#M41335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;that is better ... but:&lt;/P&gt;&lt;P&gt;sum(Rundung1) =4999989.21 that is round(x,'0.01')&lt;/P&gt;&lt;P&gt;sum(Rundung2) = 5000000 thats the formula&lt;/P&gt;&lt;P&gt;sum(Rundung3)= 4999993.91 that is round(round(x,'0.001'),'0.01')&lt;/P&gt;&lt;P&gt;sum(Rundung4)= 4999973.15 that is round(x,'0.01',5) in this case the comparison flag is wrong but see 99.035&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Alex:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2009 22:43:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171268#M41335</guid>
      <dc:creator />
      <dc:date>2009-12-01T22:43:13Z</dc:date>
    </item>
    <item>
      <title>AW:Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171269#M41336</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;at the beginning I want to discuss if there is a chance in one of the next patches that QlikView rounds with the right result (ISO standard).&lt;/P&gt;&lt;P&gt;But now it is a search for the workaround. I Have a new solution. This one works but it is tricky.&lt;/P&gt;&lt;P&gt;1. Load the original Value with&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;Zahl*1000 as Zahl&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;2. To show the Value with 2 digits use the formula&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;round(Zahl/10)/100&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Thats only a solution when you want 3 digits shown as 2. For every other count of digits you have to Load/calculate it new.&lt;/P&gt;&lt;P&gt;So - why can't QlikView do it right for every number of digits?&lt;/P&gt;&lt;P&gt;Have Fun With QV&lt;/P&gt;&lt;P&gt;Alex:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2009 19:05:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171269#M41336</guid>
      <dc:creator />
      <dc:date>2009-12-02T19:05:27Z</dc:date>
    </item>
    <item>
      <title>AW:Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171270#M41337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may find this excellent wiki entry from John Witherspoon helpful:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/wikis/qlikview-wiki/explanation-of-mathematical-errors-in-qlikview.aspx"&gt;http://community.qlik.com/wikis/qlikview-wiki/explanation-of-mathematical-errors-in-qlikview.aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 04:19:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171270#M41337</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-12-03T04:19:46Z</dc:date>
    </item>
    <item>
      <title>AW:Rounding error</title>
      <link>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171271#M41338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Alexander Schubert wrote: at the beginning I want to discuss if there is a chance in one of the next patches that QlikView rounds with the right result (ISO standard).&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;As I mention in the Wiki, that seems unlikely to happen in the forseeable future, but I don't work for QlikTech and haven't asked them if this is something they intend to fix, and if so, what their time table might be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Alexander Schubert wrote: But now it is a search for the workaround. I Have a new solution. This one works but it is tricky.&lt;BR /&gt;1. Load the original Value with&lt;BR style="padding-left:30px;" /&gt;Zahl*1000 as Zahl&lt;BR /&gt;2. To show the Value with 2 digits use the formula&lt;BR style="padding-left:30px;" /&gt;round(Zahl/10)/100&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Your workaround looks &lt;EM&gt;almost&lt;/EM&gt; right. QlikView cannot always accurately store fractional data, so if your data always has three or fewer decimal places, multiplying by 1000 during the load is the way to make certain that your numbers are stored with 100% accuracy. But your rounding expression still leaves you open to errors, as round(Zahl/10) will FIRST calculate a fraction, and then try to round it. That fraction may not be correct, so you can't guarantee that the rounded result will be correct. Instead, round Zahl to the tens position, and then divide by 1000: &lt;STRONG&gt;round(Zahl,10)/1000&lt;/STRONG&gt;. Your resulting number may not be exactly correct, and should not be used in further calculations if those calculations must be exact, but it should DISPLAY correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Alexander Schubert wrote: Thats only a solution when you want 3 digits shown as 2. For every other count of digits you have to Load/calculate it new.&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;I believe the general form of the script and rounding expression would be this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;"Source Number" * pow(10,"Max Decimal Places in Source Number") as "Converted Number"&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;round("Converted Number","Step" * pow(10,"Max Decimal Places in Source Number"))&lt;BR /&gt; / pow(10,"Max Decimal Places in Source Number")&lt;/P&gt;&lt;P&gt;Not that you would actually write it as pow(10,...). You'd just plug in something like 1000.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2009 05:03:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rounding-error/m-p/171271#M41338</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2009-12-03T05:03:33Z</dc:date>
    </item>
  </channel>
</rss>

