<?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 Dividing variables bring wrong values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329425#M460596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have defined the below variables in the system:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSales1&lt;/P&gt;&lt;P&gt;vSales2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTickets1&lt;/P&gt;&lt;P&gt;vTickets2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSales = $(vSales1) + $(vSales2)&lt;/P&gt;&lt;P&gt;vTickets = $(vTickets1) + $(vTickets2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AverageSales = ($(vSales1) + $(vSales2)) / ($(vTickets1)+$(vTickets2))&lt;/P&gt;&lt;P&gt;bring rights results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as the below formula brings wrong results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AverageSales = $(vSales) / $(vTickets)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea how to resolve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Apr 2017 07:53:14 GMT</pubDate>
    <dc:creator>madnanansari</dc:creator>
    <dc:date>2017-04-27T07:53:14Z</dc:date>
    <item>
      <title>Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329425#M460596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have defined the below variables in the system:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSales1&lt;/P&gt;&lt;P&gt;vSales2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTickets1&lt;/P&gt;&lt;P&gt;vTickets2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vSales = $(vSales1) + $(vSales2)&lt;/P&gt;&lt;P&gt;vTickets = $(vTickets1) + $(vTickets2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AverageSales = ($(vSales1) + $(vSales2)) / ($(vTickets1)+$(vTickets2))&lt;/P&gt;&lt;P&gt;bring rights results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where as the below formula brings wrong results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AverageSales = $(vSales) / $(vTickets)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any idea how to resolve this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 07:53:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329425#M460596</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T07:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329426#M460597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;any NULL-values involved?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 08:39:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329426#M460597</guid>
      <dc:creator>prieper</dc:creator>
      <dc:date>2017-04-27T08:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329427#M460598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to define the variables as below:&lt;/P&gt;&lt;P&gt; vSales = vSales1 + vSales2&lt;/P&gt;&lt;P&gt;vTickets = vTickets1 + vTickets2&lt;/P&gt;&lt;P&gt;(remove the '$')&lt;/P&gt;&lt;P&gt;You should get the correct result on &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;AverageSales = $(vSales) / $(vTickets) .&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 09:11:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329427#M460598</guid>
      <dc:creator>prachisangewar</dc:creator>
      <dc:date>2017-04-27T09:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329428#M460599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i tried to rebuild your issue and for me it works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see attached sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 10:02:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329428#M460599</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2017-04-27T10:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329429#M460600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess you missed the "=" signs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="161431" alt="Unbenannt.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/161431_Unbenannt.png" style="height: 284px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 10:06:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329429#M460600</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2017-04-27T10:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329430#M460601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you have a problem with order of operations. The divide is being done first. Adds parens to control the order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vSales = ($(vSales1) + $(vSales2))&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;vTickets = ($(vTickets1) + $(vTickets2))&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 11:16:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329430#M460601</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2017-04-27T11:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329431#M460602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To easily detect what ROb says is going wrong, try to perform the $-sign substitution yourself and see whether you get wrong precedence or skipped/missing operands in your calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I do the substitution manually, I get an almost-final expression of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;= $(vSales) / $(vTickets) into&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;= &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt; $(vSales1) + $(vSales2) / &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;$(vTickets1) + $(vTickets2)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;which means that only &lt;SPAN style="font-family: 'courier new', courier;"&gt;$(vSales2)&lt;/SPAN&gt; (or a part of that variable) is divided by &lt;SPAN style="font-family: 'courier new', courier;"&gt;$(vTickets1)&lt;/SPAN&gt; because of operator precedence.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Another time-saving suggestion: when using $-sign substitution to assemble expressions, always use &lt;EM&gt;too many parentheses&lt;/EM&gt;. They don't cost you anything but will save you many hours of searching and debugging.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Edit] Sorry, corrected first name spelling &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 12:09:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329431#M460602</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-04-27T12:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329432#M460603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no null values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 12:28:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329432#M460603</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T12:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329433#M460604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I wrongly marked this as correct answer. This does not help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 12:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329433#M460604</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T12:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329434#M460605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;$(vSales) and $(vTickets) give the right answer whereas $(vSales) / $(vTickets) bring wrong answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:22:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329434#M460605</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T13:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329435#M460606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it brings all the column having the same values. Infact I am using Qlik Sense but posted here in Qlik View. Sorry for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:23:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329435#M460606</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T13:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329436#M460607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;dont work. Infact I am using Qlik Sense instead of Qlik View. Sorry for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:24:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329436#M460607</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T13:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329437#M460608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no this is not the case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:24:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329437#M460608</guid>
      <dc:creator>madnanansari</dc:creator>
      <dc:date>2017-04-27T13:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329438#M460609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please change the forum by following the instructions given here: &lt;A href="https://community.qlik.com/thread/61072"&gt;QlikCommunity Tip: How to move your discussion thread&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 16:06:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329438#M460609</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-04-27T16:06:47Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329439#M460610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Note that in QlikView objects, $-sign substitution is performed before the object is recalculated. And cannot change row-by-row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are the vSales1 &amp;amp; 2 and vTickets1 &amp;amp; 2 variables dependent on something that should change in every row? What do they contain?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 16:31:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1329439#M460610</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-04-27T16:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dividing variables bring wrong values</title>
      <link>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1513235#M460611</link>
      <description>Thanks Rob, but isn't misleading this operation order? I don't see any case in which we would want to divide first the last element of a dollar expression before finishing the evaluation.</description>
      <pubDate>Wed, 28 Nov 2018 01:55:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dividing-variables-bring-wrong-values/m-p/1513235#M460611</guid>
      <dc:creator>julioarriaga</dc:creator>
      <dc:date>2018-11-28T01:55:19Z</dc:date>
    </item>
  </channel>
</rss>

