<?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: Rounding in Where clause - Decimal number issue in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755345#M58239</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/100273"&gt;@onmysi49&lt;/a&gt;&amp;nbsp; yeah that's the way to rounding till seconds.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Oct 2020 09:59:37 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2020-10-23T09:59:37Z</dc:date>
    <item>
      <title>Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754865#M58193</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I might be missing something very simple but I cannot figure out why this is happening:&lt;/P&gt;&lt;P&gt;I have a table MaxTS. The only purpose of this table is to find Max TimeStamp value from my source:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Max_TS:
Load
    Max(round("TimeStamp",0.00001)) as MaxTS
FROM [$(vSapL1Path)/YFIAPL5_QLIK.qvd]
(qvd);&lt;/LI-CODE&gt;&lt;P&gt;then I store it into variable call vMaxTSap:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vMaxTSap = peek('MaxTS',0);&lt;/LI-CODE&gt;&lt;P&gt;And then I would like to Load a table from my source which contains only records with this max TimeStamp:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;LOAD *    
FROM [$(vSapL1Path)/YFIAPL5_QLIK.qvd]
(qvd)
where round("TimeStamp",0.00001) = $(#vMaxTSap);&lt;/LI-CODE&gt;&lt;P&gt;The issue is that 0 lines are fetched here because apparently the values in where clause do not equal for any of the records.&lt;/P&gt;&lt;P&gt;The strange thing is that this issue occurs only if numbers are rounded to 5 decimal places. If I change the round function to 0.000001 or 0.0001, it works, numbers are equal and 914 lines are fetched from the source.&lt;/P&gt;&lt;P&gt;When I use Trace to see the vMaxTSap variable it reads:&amp;nbsp;&lt;SPAN&gt;44125.59211 in the output. The Max TimeStamp in the source is&amp;nbsp;10/21/2020 2:12:38 PM (stored in thes TS format).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It seems that round function returns a different number in the Where clause than in the Load itself?&lt;/P&gt;&lt;P&gt;I am thinking if it is not related to:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Support-Knowledge-Base/Decimal-Values-In-Qlik-Sense-And-QlikView-June-2019-and-later/ta-p/1744935" target="_blank"&gt;https://community.qlik.com/t5/Support-Knowledge-Base/Decimal-Values-In-Qlik-Sense-And-QlikView-June-2019-and-later/ta-p/1744935&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for any opinions.&lt;/P&gt;&lt;P&gt;Cheers, Ondrej&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 17:56:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754865#M58193</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2024-11-16T17:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754892#M58198</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/100273"&gt;@onmysi49&lt;/a&gt;&amp;nbsp; try below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Max_TS:
Load
    num(Max("TimeStamp")) as MaxTS
FROM [$(vSapL1Path)/YFIAPL5_QLIK.qvd]
(qvd);

Let vMaxTSap = peek('MaxTS',0);

LOAD *    
FROM [$(vSapL1Path)/YFIAPL5_QLIK.qvd]
(qvd)
where num("TimeStamp") = '$(vMaxTSap)';&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 11:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754892#M58198</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-22T11:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754920#M58199</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;thanks a lot for such a quick reply.&lt;/P&gt;&lt;P&gt;Unfortunately this does not work either, no lines fetched. Also I have tried several different combinations with num() functions already. And nothing worked. I figured out that only option that seems to work is to round the numbers. But I am puzzled why it works only with certain number of decimal places.&lt;/P&gt;&lt;P&gt;Thanks a lot. Have a good one&lt;/P&gt;&lt;P&gt;EDIT: my default dec. sep is comma -&amp;nbsp;SET DecimalSep=',';&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 12:16:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754920#M58199</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2020-10-22T12:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754969#M58203</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/100273"&gt;@onmysi49&lt;/a&gt;&amp;nbsp; one more thing you can try to actually avoid rounding issue like below&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Max_TS:
Load
    floor(Max("TimeStamp"),1/24/60) as MaxTS
FROM [$(vSapL1Path)/YFIAPL5_QLIK.qvd]
(qvd);

Let vMaxTSap = peek('MaxTS',0);

LOAD *    
FROM [$(vSapL1Path)/YFIAPL5_QLIK.qvd]
(qvd)
where floor("TimeStamp",1/24/60) = '$(vMaxTSap)';&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:43:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1754969#M58203</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-22T13:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755006#M58206</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you. I get your point - to extract only minutes fraction from the timestamp. This does not seem to work anyway.&lt;/P&gt;&lt;P&gt;What actually works is:&lt;/P&gt;&lt;P&gt;floor("TimeStamp",0.00001)&lt;BR /&gt;round("TimeStamp",0.000001)&lt;/P&gt;&lt;P&gt;(there are several more versions with different number of dec. places of floor() and round() which work)&lt;/P&gt;&lt;P&gt;But I am still wondering why it does not work for round() with 5 dec. places. What is the root cause? And if e.g. I use round with 9 dec. places, is it reliable when TS is different in future reloads of the application? I doubt that.&lt;/P&gt;&lt;P&gt;I am sorry for digging into it so much, however, I would like to know what is behind that.&lt;/P&gt;&lt;P&gt;Thanks a lot. Have a good one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:26:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755006#M58206</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2020-10-22T14:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755295#M58235</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336"&gt;@Kushal_Chawda&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;after reading&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I guess I understand what's going on here. Converting to seconds with&amp;nbsp;round(24*60*60*"TimeStamp") works like a charm.&lt;/P&gt;&lt;P&gt;Do you think my understanding is correct here?&lt;/P&gt;&lt;P&gt;Thanks a lot. Have great day.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 07:45:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755295#M58235</guid>
      <dc:creator>onmysi49</dc:creator>
      <dc:date>2020-10-23T07:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rounding in Where clause - Decimal number issue</title>
      <link>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755345#M58239</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/100273"&gt;@onmysi49&lt;/a&gt;&amp;nbsp; yeah that's the way to rounding till seconds.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2020 09:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rounding-in-Where-clause-Decimal-number-issue/m-p/1755345#M58239</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2020-10-23T09:59:37Z</dc:date>
    </item>
  </channel>
</rss>

