<?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: How to calculate variables if decimal separator is set to comma in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694847#M725837</link>
    <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;if your variable is a static number&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can use =vTest&lt;/P&gt;&lt;P&gt;and if you have a formula you can for example sum(value*vTest)&lt;/P&gt;</description>
    <pubDate>Mon, 20 Apr 2020 09:39:25 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2020-04-20T09:39:25Z</dc:date>
    <item>
      <title>How to calculate variables if decimal separator is set to comma</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694830#M725836</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;in my environment is decimal separator set as comma and I have problem with number variables. I created new QVW file, where I created new variable and displayed its value in Text Object:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;SET ThousandSep=' ';&lt;BR /&gt;SET DecimalSep=',';&lt;BR /&gt;SET MoneyThousandSep=' ';&lt;BR /&gt;SET MoneyDecimalSep=',';&lt;BR /&gt;SET MoneyFormat='# ##0,00 €;-# ##0,00 €';&lt;BR /&gt;&lt;BR /&gt;LET vTest = 1/10;&lt;/P&gt;&lt;P&gt;I have in in TextObject:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;=$(vTest)&lt;/P&gt;&lt;P&gt;But it isn't displayed, I have an error: "&lt;STRONG&gt;Error: Garbage after expression:','&lt;/STRONG&gt;". What did I wrong? If I change decimal separator in load script to dot (SET DecimalSep='.';), it works properly. Why is the result influenced by setting of the decimal separator? I thought, that DecimalSep is just a format that is used to display the value and not to evalueate it. I thought it has no effect during the calculations of the value.&lt;/P&gt;&lt;P&gt;If I have in load script SET DecimalSep=','; and in TextObject = num(vCoef, '#,##', '.', ','), it is displayed properly.&lt;BR /&gt;&lt;STRONG&gt;Does it mean, that I have to always use NUM function during calculations with variable, when I have decimal separator set to comma?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Katka&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694830#M725836</guid>
      <dc:creator>katkaKF</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variables if decimal separator is set to comma</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694847#M725837</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;if your variable is a static number&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can use =vTest&lt;/P&gt;&lt;P&gt;and if you have a formula you can for example sum(value*vTest)&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 09:39:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694847#M725837</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2020-04-20T09:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variables if decimal separator is set to comma</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694861#M725838</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I just want to know, whether it is necessary to know in the beginning of the creating the new project what number format will be used.&lt;/P&gt;&lt;P&gt;Has the setting of decimal separator influence of the way, how to work with variables? I think that is just a formatting matter and has no impact on the codeing. Am I wrong?&lt;/P&gt;&lt;P&gt;I have a &lt;STRONG&gt;Slider Object&lt;/STRONG&gt;&amp;nbsp;with variable.&amp;nbsp;&amp;nbsp;I have in script:&lt;/P&gt;&lt;P&gt;SET DecimalSep=',';&lt;/P&gt;&lt;P&gt;vCoef = 0;&lt;/P&gt;&lt;P&gt;In Slider Object I set this variable and on the Caption Tab I have Title Text:&lt;/P&gt;&lt;P&gt;=$(vCoef)&lt;/P&gt;&lt;P&gt;In the Chart I have&amp;nbsp;What If expression set to:&lt;/P&gt;&lt;P&gt;SUM(UnitCost * UnitsBalance) + $(vCoef) * (SUM(UnitCost * UnitsBalance))&lt;/P&gt;&lt;P&gt;In variable overwie I can see, that the variable vCoef is set to 2,3 instead od 2.3 and int the title bar of slider is an error: "&lt;SPAN&gt;Error: Garbage after expression:',' " and the What If column in the chart is empty:&amp;nbsp;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SliderObject3.png" style="width: 706px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32122i4207451591CE8B7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="SliderObject3.png" alt="SliderObject3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I manualy change setting of the constant DecimalSep to dot:&lt;/P&gt;&lt;P&gt;SET DecimalSep='.';&lt;/P&gt;&lt;P&gt;it works.&lt;SPAN&gt;&amp;nbsp; It also works,&amp;nbsp;if I replaced&amp;nbsp;&lt;STRONG&gt;vCoef&amp;nbsp;&lt;/STRONG&gt;with =&amp;nbsp;&lt;STRONG&gt;num(vCoef, '#,##', '.', ',')&amp;nbsp;&lt;/STRONG&gt;and everything is correct, but I dont think that it is what I should do. Or is it? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Should I always use NUM if I work with calculated variable and DecimalSep is comma?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Katka&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 10:11:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694861#M725838</guid>
      <dc:creator>katkaKF</dc:creator>
      <dc:date>2020-04-20T10:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variables if decimal separator is set to comma</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694996#M725839</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;try this first&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the title of the slider write : =vCoef&amp;nbsp;&lt;/P&gt;&lt;P&gt;and in the chart&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SUM(UnitCost * UnitsBalance) + vCoef * (SUM(UnitCost * UnitsBalance))&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 16:57:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694996#M725839</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2020-04-20T16:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variables if decimal separator is set to comma</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694998#M725840</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;that works, wow!&lt;/P&gt;&lt;P&gt;But I am confused now, what is the difference between vCoef and $(vCoef)? What does it mean, that it is static number? I thought, that static number means, that it is a constant. In slider object the value of this variable is changing, and despite that is it a static number?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 17:21:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1694998#M725840</guid>
      <dc:creator>katkaKF</dc:creator>
      <dc:date>2020-04-20T17:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate variables if decimal separator is set to comma</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1695017#M725841</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;the $(vCoef) calls for a calculation as variables might hold expressions or mathematical functions&amp;nbsp;&lt;/P&gt;&lt;P&gt;if the variable is a number than you don't need the $ sign&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Apr 2020 18:42:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-variables-if-decimal-separator-is-set-to-comma/m-p/1695017#M725841</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2020-04-20T18:42:33Z</dc:date>
    </item>
  </channel>
</rss>

