<?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: expression with variable doesn't calculate correct in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054255#M353541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. I haven't looked carefully enough to see that you multiplied the first expression like the second one. Nevertheless are both expressions not the same. An expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp1*currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be applied on the row-level of your data and an expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(exp1 + exp2)* currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;multiplied the currency on a higher consolidated level and this musn't be the same. For example there could be NULL's on the row-level and also different NULL's on the consolidated level. I think I would use as expression something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangesum(exp1*currency, exp2*currency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it will be depend on your requirements which one provides the correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 May 2016 14:44:15 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2016-05-02T14:44:15Z</dc:date>
    <item>
      <title>expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054249#M353535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum ({&amp;lt; ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus= {'On hold'},&amp;nbsp; OnHoldReason={'Treated - waiting for client','Treated - waiting for payment','Untreated'}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&amp;nbsp;&amp;nbsp; OrderQtyOpen) +&lt;/P&gt;&lt;P&gt;sum ({&amp;lt; ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus= {'Placed'}&amp;gt;}&amp;nbsp; OrderQtyOpen)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then made a variable out of it: eOpenOrdersTotal#&lt;/P&gt;&lt;P&gt;Then used the variable instead of the formula like this:&lt;/P&gt;&lt;P&gt;$(eOpenOrdersTotal#)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the expression or the variable i get exactly the same quantities, so that's ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before i would calculate the value of the first expression&amp;nbsp; with the second expression like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum ({&amp;lt; ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus= {'On hold'},&amp;nbsp; OnHoldReason={'Treated - waiting for client','Treated - waiting for payment','Untreated'}&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;}&amp;nbsp;&amp;nbsp; OrderQtyOpen*SkuPricePurchaseCurrency) +&lt;/P&gt;&lt;P&gt;sum ({&amp;lt; ProductStatus = {'Active', 'Einde gamma', 'Sample'}, OrderStatus= {'Placed'}&amp;gt;}&amp;nbsp; OrderQtyOpen*SkuPricePurchaseCurrency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's the same as the first expression but i multiplied&amp;nbsp; with "SkuPricePurchaseCurrency" to get a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of making a second variable i calculated like this:&lt;/P&gt;&lt;P&gt;$(eOpenOrdersTotal#) * SkuPricePurchaseCurrency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the calculation to get the value doesn't give me the same result as when i use the second expression,&lt;/P&gt;&lt;P&gt;and i don't get a total in my pivot table either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am i doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 13:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054249#M353535</guid>
      <dc:creator>chriscools</dc:creator>
      <dc:date>2016-05-02T13:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054250#M353536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both expressions are doing not the same. The first is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp1 + exp2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you multiplied it as variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(exp1 + exp2) * Currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whereby in your expression you used:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp1 + (exp2 * Currency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and therefore you get different results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 14:02:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054250#M353536</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-02T14:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054251#M353537</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am assuming that "&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;SkuPricePurchaseCurrency" has some value, for example 200. &lt;/SPAN&gt;Try below and see if you get any results:&lt;/P&gt;&lt;P&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;STRONG&gt;$(eOpenOrdersTotal#) * 200&lt;/STRONG&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;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 14:03:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054251#M353537</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2016-05-02T14:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054252#M353538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx for you reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the variable is indeed : exp1 + exp2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the second expression to calculate the value is: (exp1*currency) + (exp2*currency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that should be the same as : (exp1 + exp2)* currency&lt;/P&gt;&lt;P&gt;and therefore the same as: variable * currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no? perhaps i'm missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;grtz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 14:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054252#M353538</guid>
      <dc:creator>chriscools</dc:creator>
      <dc:date>2016-05-02T14:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054253#M353539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Thirumala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the SkuPricePurchaseCurrency indeed has&amp;nbsp; a value per sku (which is the dimension of the table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i change the&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;SkuPricePurchaseCurrency by a value (2) then i get a total for the expression with the variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;but i still get different values when i also change &lt;SPAN style="font-size: 13.3333px;"&gt;SkuPricePurchaseCurrency in the second expression.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;grtz,&lt;/P&gt;&lt;P&gt;chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 14:31:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054253#M353539</guid>
      <dc:creator>chriscools</dc:creator>
      <dc:date>2016-05-02T14:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054254#M353540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible to post a small sample showing the issue and your expected output, so that we can test it out and come up with a solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 14:37:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054254#M353540</guid>
      <dc:creator>trdandamudi</dc:creator>
      <dc:date>2016-05-02T14:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: expression with variable doesn't calculate correct</title>
      <link>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054255#M353541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. I haven't looked carefully enough to see that you multiplied the first expression like the second one. Nevertheless are both expressions not the same. An expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;exp1*currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will be applied on the row-level of your data and an expression like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(exp1 + exp2)* currency&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;multiplied the currency on a higher consolidated level and this musn't be the same. For example there could be NULL's on the row-level and also different NULL's on the consolidated level. I think I would use as expression something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rangesum(exp1*currency, exp2*currency)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it will be depend on your requirements which one provides the correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 May 2016 14:44:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/expression-with-variable-doesn-t-calculate-correct/m-p/1054255#M353541</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-05-02T14:44:15Z</dc:date>
    </item>
  </channel>
</rss>

