<?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 Using LEFT and INDEX to get around binary issue with Floor() in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Using-LEFT-and-INDEX-to-get-around-binary-issue-with-Floor/m-p/1815262#M66695</link>
    <description>&lt;P&gt;So myself and a colleague found out quite some time ago that Floor sometimes has issues with certain figures (and Round too).&amp;nbsp; As small as the differences are, this causes problems with Test where they will point out their system test in SQL of the DB doesn't match what Qlik shows.&amp;nbsp; Also sometimes there are conditional colour/symbol trigger issues where it puts a '1' in the 15th decimal place for certain numbers.&amp;nbsp; It is probably binary related too!&lt;/P&gt;&lt;P&gt;My colleague found that someone years ago in QlikView used 'Left' to effectively cut off the figure to the places required to act as a floor in some respect. However because percentage/numbers with required decimal places can vary in number of chars depending on the result it made it tricky to nail down the char number criteria.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So we came up with a possible solution.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;left('50.56555334',(index('50.56555334',&lt;/SPAN&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;SPAN&gt;))+4) results in 50.5655&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index on its own is 3.&amp;nbsp; so 3+4=7 chars.&amp;nbsp; &amp;nbsp;&amp;nbsp;50.5655 is 7 chars including the '.'&lt;BR /&gt;&lt;BR /&gt;The idea is that it searches for the placement of the '.', counts the number of places then I add the number of chars I want from the '.' depending on how many decimal places I want.&amp;nbsp; Anything to the left of the '.' is included in full.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(This is different when it is a percentage obviously and need to apply number of dec places based on what the figure is before it is in % format, like round/floor.)&lt;BR /&gt;&lt;BR /&gt;I generated over 1 million records and utilised expressions to count/sum or divide by for percentages in KPI charts and bar/line charts.&amp;nbsp; I utilised filters for month/year.&amp;nbsp; The calculations are instant and appear to be correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So what I want to ask, am I missing something with this?&amp;nbsp; I wondered about performance with more complex expressions but the data load indexing is meant to be what gives good performance with calculations and filtering?&amp;nbsp; If there is a better way, I'd be interested but I'd like to know at least that what we've done isn't a bad idea.&lt;/P&gt;&lt;P&gt;For reference, this only gives examples with LEFT and INDEX in Text format on Qlik Sense Windows FAQ for may 2021 that I could see so far.&amp;nbsp; I am using Qlik Sense Kubernetes.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 14:41:02 GMT</pubDate>
    <dc:creator>BenODBS</dc:creator>
    <dc:date>2021-06-15T14:41:02Z</dc:date>
    <item>
      <title>Using LEFT and INDEX to get around binary issue with Floor()</title>
      <link>https://community.qlik.com/t5/App-Development/Using-LEFT-and-INDEX-to-get-around-binary-issue-with-Floor/m-p/1815262#M66695</link>
      <description>&lt;P&gt;So myself and a colleague found out quite some time ago that Floor sometimes has issues with certain figures (and Round too).&amp;nbsp; As small as the differences are, this causes problems with Test where they will point out their system test in SQL of the DB doesn't match what Qlik shows.&amp;nbsp; Also sometimes there are conditional colour/symbol trigger issues where it puts a '1' in the 15th decimal place for certain numbers.&amp;nbsp; It is probably binary related too!&lt;/P&gt;&lt;P&gt;My colleague found that someone years ago in QlikView used 'Left' to effectively cut off the figure to the places required to act as a floor in some respect. However because percentage/numbers with required decimal places can vary in number of chars depending on the result it made it tricky to nail down the char number criteria.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;So we came up with a possible solution.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;left('50.56555334',(index('50.56555334',&lt;/SPAN&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;SPAN&gt;))+4) results in 50.5655&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index on its own is 3.&amp;nbsp; so 3+4=7 chars.&amp;nbsp; &amp;nbsp;&amp;nbsp;50.5655 is 7 chars including the '.'&lt;BR /&gt;&lt;BR /&gt;The idea is that it searches for the placement of the '.', counts the number of places then I add the number of chars I want from the '.' depending on how many decimal places I want.&amp;nbsp; Anything to the left of the '.' is included in full.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(This is different when it is a percentage obviously and need to apply number of dec places based on what the figure is before it is in % format, like round/floor.)&lt;BR /&gt;&lt;BR /&gt;I generated over 1 million records and utilised expressions to count/sum or divide by for percentages in KPI charts and bar/line charts.&amp;nbsp; I utilised filters for month/year.&amp;nbsp; The calculations are instant and appear to be correct.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So what I want to ask, am I missing something with this?&amp;nbsp; I wondered about performance with more complex expressions but the data load indexing is meant to be what gives good performance with calculations and filtering?&amp;nbsp; If there is a better way, I'd be interested but I'd like to know at least that what we've done isn't a bad idea.&lt;/P&gt;&lt;P&gt;For reference, this only gives examples with LEFT and INDEX in Text format on Qlik Sense Windows FAQ for may 2021 that I could see so far.&amp;nbsp; I am using Qlik Sense Kubernetes.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 14:41:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Using-LEFT-and-INDEX-to-get-around-binary-issue-with-Floor/m-p/1815262#M66695</guid>
      <dc:creator>BenODBS</dc:creator>
      <dc:date>2021-06-15T14:41:02Z</dc:date>
    </item>
  </channel>
</rss>

