<?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 Syntax for one variable divided by another variable...... What am I doing wrong? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517037#M750121</link>
    <description>&lt;P&gt;I have a variable vSalesUnits which is a total of units.&lt;/P&gt;&lt;P&gt;I have a variable vSalesRevenue which is a total of types of revenues.&lt;/P&gt;&lt;P&gt;Each are working independently but when I try to create a new variable for the Per Unit called vSalesPer_Unit where I divide the total revenue by the units, I can't get it to calculate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;vSalesPer_Unit is defined like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $(&lt;SPAN&gt;vSalesRevenue&amp;nbsp;&lt;/SPAN&gt;) / $(&lt;SPAN&gt;vSalesUnits&amp;nbsp;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;... doesn't work for me&lt;/P&gt;&lt;P&gt;I've tried putting additional () around each, doesn't work&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ($(&lt;/SPAN&gt;&lt;SPAN&gt;vSalesRevenue&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;)) /( $(&lt;/SPAN&gt;&lt;SPAN&gt;vSalesUnits&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've tried the Div function with and without extra parentheses, didn't work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I searched and found a few postings of other people having a similar issue, but I can't find a solution other than extra parentheses.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can someone tell what am doing wrong or make a suggestion?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 05:02:59 GMT</pubDate>
    <dc:creator>dena_reavis</dc:creator>
    <dc:date>2024-11-16T05:02:59Z</dc:date>
    <item>
      <title>Syntax for one variable divided by another variable...... What am I doing wrong?</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517037#M750121</link>
      <description>&lt;P&gt;I have a variable vSalesUnits which is a total of units.&lt;/P&gt;&lt;P&gt;I have a variable vSalesRevenue which is a total of types of revenues.&lt;/P&gt;&lt;P&gt;Each are working independently but when I try to create a new variable for the Per Unit called vSalesPer_Unit where I divide the total revenue by the units, I can't get it to calculate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;vSalesPer_Unit is defined like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; $(&lt;SPAN&gt;vSalesRevenue&amp;nbsp;&lt;/SPAN&gt;) / $(&lt;SPAN&gt;vSalesUnits&amp;nbsp;&lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;... doesn't work for me&lt;/P&gt;&lt;P&gt;I've tried putting additional () around each, doesn't work&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; ($(&lt;/SPAN&gt;&lt;SPAN&gt;vSalesRevenue&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;)) /( $(&lt;/SPAN&gt;&lt;SPAN&gt;vSalesUnits&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've tried the Div function with and without extra parentheses, didn't work.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I searched and found a few postings of other people having a similar issue, but I can't find a solution other than extra parentheses.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can someone tell what am doing wrong or make a suggestion?&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:02:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517037#M750121</guid>
      <dc:creator>dena_reavis</dc:creator>
      <dc:date>2024-11-16T05:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for one variable divided by another variable...... What am I doing wrong?</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517047#M750122</link>
      <description>&lt;P&gt;Does this work for you?&lt;/P&gt;&lt;P&gt;vDivide&amp;nbsp;=vSalesRevenue/vSalesUnits&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="__.png" style="width: 787px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1668iB700C66D55D01C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="__.png" alt="__.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 22:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517047#M750122</guid>
      <dc:creator>othniel2014</dc:creator>
      <dc:date>2018-12-05T22:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for one variable divided by another variable...... What am I doing wrong?</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517156#M750123</link>
      <description>&lt;P&gt;Maybe your variable-result contains a comma as thousand/decimal-delimiter. That's fine by a single-output but it's not a valid number if you want to calculate anything on top of it. In this case you could either adjust the formatting by the variable-creation or you need to consider it by calling the variables, for example with something like:&lt;/P&gt;&lt;P&gt;num(num#($(&lt;SPAN&gt;vSalesRevenue&amp;nbsp;&lt;/SPAN&gt;), '#.##0,00', ',', '.') / num#($(&lt;SPAN&gt;vSalesUnits&amp;nbsp;&lt;/SPAN&gt;), '#.##0,00', ',', '.'), 'YourFormat')&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 07:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517156#M750123</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-12-06T07:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for one variable divided by another variable...... What am I doing wrong?</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517411#M750124</link>
      <description>&lt;P&gt;Thank you Marcus!&lt;/P&gt;&lt;P&gt;While I was trying your suggestion, I noticed&amp;nbsp;a space after one of the variable names before the second parentheses of the dollar sign expansion. I admit I did not think that would cause an issue, but that seems to have been it. I fixed it and now it calculates just fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had&amp;nbsp;&lt;SPAN&gt;$(&lt;/SPAN&gt;&lt;SPAN&gt;vSalesUnits&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;) instead of&amp;nbsp;$(vSalesUnits)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you both for your quick responses.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 13:37:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-for-one-variable-divided-by-another-variable-What-am-I/m-p/1517411#M750124</guid>
      <dc:creator>dena_reavis</dc:creator>
      <dc:date>2018-12-06T13:37:45Z</dc:date>
    </item>
  </channel>
</rss>

