<?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: Sub function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sub-function/m-p/1268718#M399316</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know whether this will help or not but you can also use below for formatting your numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewcookbook.com/2016/05/scaling-numbers-and-dse-tips/" title="http://qlikviewcookbook.com/2016/05/scaling-numbers-and-dse-tips/"&gt;Scaling Numbers and DSE Tips | Qlikview Cookbook&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Dec 2016 18:01:28 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2016-12-15T18:01:28Z</dc:date>
    <item>
      <title>Sub function</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-function/m-p/1268717#M399315</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;&lt;/P&gt;&lt;P&gt;I'm trying to do a function like i show, but i can't get the result that i hope.&lt;/P&gt;&lt;P&gt;The function it's transformating the value of the parameter to a format value even Milllion, thousands....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here I put some examples to do this with a function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUB formatNum (Value)&lt;SPAN style="font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF Value&amp;lt;num(100000) THEN &lt;/P&gt;&lt;P&gt;&amp;nbsp; Value = Num(Value,'#.##0 €;-#.##0 €')&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSEIF Value&amp;lt;num(1000000)&lt;/P&gt;&lt;P&gt;&amp;nbsp; Value = Num(Value/num(1000),'#.##0,0 k€;-#.##0,0 k€')&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp; Value = Num(Value/num(1000000),'#.##0,00 M€;-#.##0,00 M€')&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSUB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR with a Calculated Variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET suma= 'IF($1&amp;lt;num(99999), Num($1,"#.##0 €;-#.##0 €"), IF($1&amp;lt;num(1000000), Num($1/num(1000),"#.##0,0 k€;-#.##0,0 k€"), Num($1/num(1000000),"#.##0,00 M€;-#.##0,00 M€")))';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code its rigth, but i can't call the sub function from an text object, and i can't get the correct result with the calculatedValue because I dont escape the simple comma char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: to call the calculated variable use:&lt;/P&gt;&lt;P&gt;=$(suma(3131231211231223))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks All and Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 16:22:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-function/m-p/1268717#M399315</guid>
      <dc:creator>enriquem</dc:creator>
      <dc:date>2016-12-15T16:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Sub function</title>
      <link>https://community.qlik.com/t5/QlikView/Sub-function/m-p/1268718#M399316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't know whether this will help or not but you can also use below for formatting your numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewcookbook.com/2016/05/scaling-numbers-and-dse-tips/" title="http://qlikviewcookbook.com/2016/05/scaling-numbers-and-dse-tips/"&gt;Scaling Numbers and DSE Tips | Qlikview Cookbook&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2016 18:01:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sub-function/m-p/1268718#M399316</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2016-12-15T18:01:28Z</dc:date>
    </item>
  </channel>
</rss>

