<?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: How to calculate sales margin with columns from 2 tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1667148#M730413</link>
    <description>&lt;P&gt;Hi Based on what your formula dictated, your result seems correct. Most are negative but it also returns positive value.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jan 2020 07:06:15 GMT</pubDate>
    <dc:creator>alex00321</dc:creator>
    <dc:date>2020-01-20T07:06:15Z</dc:date>
    <item>
      <title>How to calculate sales margin with columns from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1662458#M730408</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;Can you help me with expression for calculating a sales margin? I have two tables:&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;Order ID, Line NO, Product ID, Quantity, Order Unit Price, Discount&lt;/P&gt;&lt;P&gt;Table 2:&lt;/P&gt;&lt;P&gt;Product ID, Product Name, Category ID, Quantity Per Unit, Unit Cost, Unit Price, Units In Stock, Units On Order&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;I thought that sales margin should calculate like:&lt;/P&gt;&lt;P&gt;(Sum (Quantity*(Order Unit Price*(1-Discount)))-Sum (Quantity*Unit Price))/Sum (Quantity*(Order Unit Price*(1-Discount)))&lt;/P&gt;&lt;P&gt;But I am not sure about this field&amp;nbsp;Quantity, or it is not correct at all?&lt;/P&gt;&lt;P&gt;Thank you for your answers&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1662458#M730408</guid>
      <dc:creator>IvanaGru90</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate sales margin with columns from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1662765#M730410</link>
      <description>&lt;P&gt;Hi how about you attach a sample file and clarify your expected result? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 07:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1662765#M730410</guid>
      <dc:creator>alex00321</dc:creator>
      <dc:date>2020-01-06T07:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate sales margin with columns from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1662945#M730411</link>
      <description>&lt;P&gt;Ivana, I think it might be better to just have Google searched this one.&amp;nbsp; Here is a pretty decent link I found that should help confirm your thoughts I hope:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.accountingtools.com/articles/how-to-calculate-sales-margin.html" target="_blank"&gt;https://www.accountingtools.com/articles/how-to-calculate-sales-margin.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hopefully that will help you translate things in your use case to get the correct result.&amp;nbsp; Feel free to Google yourself for other examples too, I got a ton of hits, and I searched for "sales margin definition".&amp;nbsp; Shout if I have misunderstood what you needed.&lt;/P&gt;
&lt;P&gt;Example QVW files can be helpful by the way, as it does let folks see your data model and your sheet objects etc. to be able to see everything directly to try to be sure you are doing the correct things, but in this case, I am not sure it is needed if I have hit on the right thing for you.&amp;nbsp; If you were more trying to figure out the correct QlikView syntax, then a sample QVW will likely be very helpful.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Brett&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 14:24:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1662945#M730411</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2020-01-06T14:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate sales margin with columns from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1664066#M730412</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I attached a sample file. My results for sales margin are mostly negative, but I am not sure that it is correct.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 12:12:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1664066#M730412</guid>
      <dc:creator>IvanaGru90</dc:creator>
      <dc:date>2020-01-09T12:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate sales margin with columns from 2 tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1667148#M730413</link>
      <description>&lt;P&gt;Hi Based on what your formula dictated, your result seems correct. Most are negative but it also returns positive value.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jan 2020 07:06:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-calculate-sales-margin-with-columns-from-2-tables/m-p/1667148#M730413</guid>
      <dc:creator>alex00321</dc:creator>
      <dc:date>2020-01-20T07:06:15Z</dc:date>
    </item>
  </channel>
</rss>

