<?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 numbers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336017#M412103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;STRONG&gt;&lt;EM&gt;if(Value&amp;lt;=1000,left(Value,1)&amp;amp; Repeat(0,len(Value)-1),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if(Value&amp;gt;1000 and Value&amp;lt;10000,left(Value,1)&amp;amp; Repeat(0,len(Value)-1),&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(Value&amp;gt;=10000,left(Value,2)&amp;amp; Repeat(0,len(Value)-2)))) as Number&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Inline [&lt;/P&gt;&lt;P&gt;Value&lt;/P&gt;&lt;P&gt;101&lt;/P&gt;&lt;P&gt;456&lt;/P&gt;&lt;P&gt;302&lt;/P&gt;&lt;P&gt;936&lt;/P&gt;&lt;P&gt;1278&lt;/P&gt;&lt;P&gt;2111&lt;/P&gt;&lt;P&gt;5724&lt;/P&gt;&lt;P&gt;12418&lt;/P&gt;&lt;P&gt;7621478&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/167781_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jun 2017 12:52:38 GMT</pubDate>
    <dc:creator>Kushal_Chawda</dc:creator>
    <dc:date>2017-06-22T12:52:38Z</dc:date>
    <item>
      <title>rounding numbers</title>
      <link>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336015#M412101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a requirement as below and wanted to check if anyone has a better way of approaching it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. If the number is &amp;lt;=1000 then i want to round it to the nearest 100&lt;/P&gt;&lt;P&gt;2. if the number is &amp;gt;1000 and &amp;lt;10000, then i want to round it to the nearest 1000. For ex: 1234 would be 1000&lt;/P&gt;&lt;P&gt;3. if the number is &amp;gt;=10000&amp;nbsp; i want to keep the first 2 digits and replace the rest with 0's &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3a) if the number is 12418, the result is 12000&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3b) &lt;/SPAN&gt;If the number is 7621478, the result is 7600000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently i am using a combination of if statements,ceil and pow function. &lt;/P&gt;&lt;P&gt;if(Value&amp;lt;1000,ceil(&lt;SPAN style="font-size: 13.3333px;"&gt;Value&lt;/SPAN&gt;,100),&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(&lt;SPAN style="font-size: 13.3333px;"&gt;Value&lt;/SPAN&gt;&amp;gt;=1000 and &lt;SPAN style="font-size: 13.3333px;"&gt;Value&lt;/SPAN&gt; &amp;lt;10000,ceil(&lt;SPAN style="font-size: 13.3333px;"&gt;Value&lt;/SPAN&gt;,1000),&lt;/P&gt;&lt;P&gt;&amp;nbsp; left(&lt;SPAN style="font-size: 13.3333px;"&gt;Value&lt;/SPAN&gt;,2)* pow(10,len(round(&lt;SPAN style="font-size: 13.3333px;"&gt;Value&lt;/SPAN&gt;,1))-2)&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate any help from the members,&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jun 2017 19:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336015#M412101</guid>
      <dc:creator>srik00001</dc:creator>
      <dc:date>2017-06-21T19:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: rounding numbers</title>
      <link>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336016#M412102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sri&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be like this (look attached file).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Value&amp;lt;1000, Div(Value, 100)*100,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(Value&amp;gt;=1000 And Value&amp;lt;10000, Div(Value, 1000)*1000,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Div(Value, Pow(10,(Len(Value)-2)))*Pow(10,(Len(Value)-2))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Andrey&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2017 08:30:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336016#M412102</guid>
      <dc:creator>ahaahaaha</dc:creator>
      <dc:date>2017-06-22T08:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: rounding numbers</title>
      <link>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336017#M412103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;STRONG&gt;&lt;EM&gt;if(Value&amp;lt;=1000,left(Value,1)&amp;amp; Repeat(0,len(Value)-1),&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if(Value&amp;gt;1000 and Value&amp;lt;10000,left(Value,1)&amp;amp; Repeat(0,len(Value)-1),&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;if(Value&amp;gt;=10000,left(Value,2)&amp;amp; Repeat(0,len(Value)-2)))) as Number&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Inline [&lt;/P&gt;&lt;P&gt;Value&lt;/P&gt;&lt;P&gt;101&lt;/P&gt;&lt;P&gt;456&lt;/P&gt;&lt;P&gt;302&lt;/P&gt;&lt;P&gt;936&lt;/P&gt;&lt;P&gt;1278&lt;/P&gt;&lt;P&gt;2111&lt;/P&gt;&lt;P&gt;5724&lt;/P&gt;&lt;P&gt;12418&lt;/P&gt;&lt;P&gt;7621478&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/167781_Capture.JPG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2017 12:52:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/rounding-numbers/m-p/1336017#M412103</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2017-06-22T12:52:38Z</dc:date>
    </item>
  </channel>
</rss>

