<?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: Sum with multiple conditions giving wrong end value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843543#M69810</link>
    <description>&lt;P&gt;Hi OR,&lt;/P&gt;&lt;P&gt;Thank you again, that's got it (though it was missing one more ) before the *).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your time and speedy responses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards Daryn&lt;/P&gt;</description>
    <pubDate>Thu, 07 Oct 2021 12:37:41 GMT</pubDate>
    <dc:creator>Daryn</dc:creator>
    <dc:date>2021-10-07T12:37:41Z</dc:date>
    <item>
      <title>Sum with multiple conditions giving wrong end value</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843514#M69806</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I am still quite new to Qlik Sense and taught through this great community and some Youtubing!&lt;/P&gt;&lt;P&gt;I am a bit stuck with the following as it doesn't give the result expected for the margin as a&amp;nbsp; %&lt;/P&gt;&lt;P&gt;To begin I have a margin calculation that works okay.&lt;/P&gt;&lt;P&gt;* Sum of revenue minus costs divided by revenue (*100 for percentage)&amp;nbsp;&lt;/P&gt;&lt;P&gt;(sum (NETWR) - sum (WAVWR)) / sum ([NETWR])*100&lt;/P&gt;&lt;P&gt;This produces the correct calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I then want to apply this across some other charts but with modified selections.&lt;/P&gt;&lt;P&gt;*Sum where Sales organization = UK99 and distribution channel = WO, revenue minus costs divided by revenue (*100 for percentage)&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt; VKORG = {'UK99'}, VTWEG -={'WO'}&amp;gt;} ((NETWR-WAVWR)/[NETWR]) *100)&lt;/P&gt;&lt;P&gt;I get a result in the millions rather than what I expect at say 40%.&lt;/P&gt;&lt;P&gt;I tried as an IF at the start but with no joy. Is it because I am not summing the individual NETWR, WAVWR etc as in the original Margins calculation?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry but I am completely stuck on this one &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help appreciated.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daryn&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:03:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843514#M69806</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2021-10-07T12:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with multiple conditions giving wrong end value</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843521#M69807</link>
      <description>&lt;P&gt;Your original calculation has three separate sums(), but your new one appears to have all three fields lumped into the same sum(). Try writing the new expression the same way, including the set analysis within each sum.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:08:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843521#M69807</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-10-07T12:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with multiple conditions giving wrong end value</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843527#M69808</link>
      <description>&lt;P&gt;Hi OR,&lt;/P&gt;&lt;P&gt;Thanks for the speedy response!&lt;/P&gt;&lt;P&gt;I get an error 'Nested aggregation is not allowed when trying that'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt; VKORG = {'UK99'}, VTWEG -={'WO'}&amp;gt;} (sum (NETWR) - sum (WAVWR)) / sum (NETWR)*100 )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry, await any update.&lt;/P&gt;&lt;P&gt;Thanks Daryn&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:13:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843527#M69808</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2021-10-07T12:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with multiple conditions giving wrong end value</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843533#M69809</link>
      <description>&lt;P&gt;Keep the same Syntax as the original...&lt;/P&gt;&lt;P&gt;(SUM ({&amp;lt; VKORG = {'UK99'}, VTWEG -={'WO'}&amp;gt;} NETWR)&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;SUM ({&amp;lt; VKORG = {'UK99'}, VTWEG -={'WO'}&amp;gt;} WAVWR))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;(SUM ({&amp;lt; VKORG = {'UK99'}, VTWEG -={'WO'}&amp;gt;} NETWR)&lt;/P&gt;&lt;P&gt;* 100&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If that isn't right for what you need, you may have to use aggr() for advanced aggregation of the results for a certain dimension level, but if that's the case, you'll need to be more specific about the structure of your object and aggregation requirements.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:24:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843533#M69809</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-10-07T12:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Sum with multiple conditions giving wrong end value</title>
      <link>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843543#M69810</link>
      <description>&lt;P&gt;Hi OR,&lt;/P&gt;&lt;P&gt;Thank you again, that's got it (though it was missing one more ) before the *).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Really appreciate your time and speedy responses.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards Daryn&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 12:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Sum-with-multiple-conditions-giving-wrong-end-value/m-p/1843543#M69810</guid>
      <dc:creator>Daryn</dc:creator>
      <dc:date>2021-10-07T12:37:41Z</dc:date>
    </item>
  </channel>
</rss>

