<?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: calculating margin in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/calculating-margin/m-p/372922#M138674</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you are using an equal sign where it mustn't be placed (first letter, 6th line).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then and more important, you are embedding aggregation functions into another aggregation function (sum into sum), which is not allowed without using advanced aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your then-else branches are also not as you intended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help you more with your syntax, could you describe a bit closer in what context you want to use your expression (e.g. in a table chart (with what dimensions?))? For example, is your data already grouped by btwcode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 15:34:12 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-05-29T15:34:12Z</dc:date>
    <item>
      <title>calculating margin</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-margin/m-p/372921#M138673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello, I'm trying to calculate the relative margin for products which have a VAT H(igh) or L(ow) but it does nog give any result back, i think because i'm trying to take the sum of it all Qlikview does not understand what i want. This is the formula i am using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=((sum(&lt;BR /&gt;if(btwcode = {'H'},&lt;/P&gt;&lt;P&gt;{&amp;lt;date = {'$(=Date(today()-1))'} &amp;gt;} sales)/1.19)-(sum({&amp;lt;date = {'$(=Date(today()-1))'} &amp;gt;} inkoopprijs)))/(sum({&amp;lt;date = {'$(=Date(today()-1))'} &amp;gt;} sales)/1.19)&lt;BR /&gt;,&lt;BR /&gt;=((sum({&amp;lt;date = {'$(=Date(today()-1))'} &amp;gt;} sales)/1.06)-(sum({&amp;lt;date = {'$(=Date(today()-1))'} &amp;gt;} inkoopprijs)))/(sum({&amp;lt;date = {'$(=Date(today()-1))'} &amp;gt;} sales)/1.06)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;Is the formula wrong or my approach?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 15:15:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-margin/m-p/372921#M138673</guid>
      <dc:creator />
      <dc:date>2012-05-29T15:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: calculating margin</title>
      <link>https://community.qlik.com/t5/QlikView/calculating-margin/m-p/372922#M138674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you are using an equal sign where it mustn't be placed (first letter, 6th line).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then and more important, you are embedding aggregation functions into another aggregation function (sum into sum), which is not allowed without using advanced aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your then-else branches are also not as you intended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help you more with your syntax, could you describe a bit closer in what context you want to use your expression (e.g. in a table chart (with what dimensions?))? For example, is your data already grouped by btwcode?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 15:34:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/calculating-margin/m-p/372922#M138674</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-05-29T15:34:12Z</dc:date>
    </item>
  </channel>
</rss>

