<?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: Percentage Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668925#M1082102</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using a Straight Table, you can try to change the Total Mode for the Margin% to Average. You can find the Total Mode by going to the Expressions tab, selecting Margin% and changing the Total Mode.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="61358" alt="TotalMode.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/61358_TotalMode.JPG.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jun 2014 15:39:28 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-06-27T15:39:28Z</dc:date>
    <item>
      <title>Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668919#M1082095</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;Please could somebody help me with a percentage calculation?&lt;/P&gt;&lt;P&gt;I am busy with What If analysis and Input boxes and have the below scenario:&lt;/P&gt;&lt;P&gt;I have 4 products with a Sales Price. The user is allowed to enter a Discount% into an Input box. I then calculate the Fee after Discount. Each of these products have a Payback (Cost of Sale). I then calculate the Margin which is the Sales Price - Discount% - Payback.&amp;nbsp; After this I calculate the Margin%.&amp;nbsp; It calculates the Margin% per product correctly, but my problem is with the Total Margin% which is the 10% in red. It should actually be the 31% in green.&amp;nbsp; It looks like it does the 20% Discount on the Total Sales Price and calculates the Margin% from there.&amp;nbsp; Just below the table you can see the calculations I use.&amp;nbsp; What should I change so it would use the Total Margin (4300.2) / Total Payback (13860) to get the 31% &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" height="26" style="width: 626px; height: 26px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Product&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Sales Price&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Discount%&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Fee after Discount&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Payback&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Margin&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Margin%&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Header&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;TOTAL&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;19116&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;18160.2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG&gt;13860&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;STRONG&gt;300.2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG style="color: #ff0000;"&gt;10%&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;STRONG style="color: #008000;"&gt;31%&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3465&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1314&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;38%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3465&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1314&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;38%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3823.2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3465&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;358.2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;D&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4779&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;3465&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1314&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;38%&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Sales Price = sum(ExchangeFee*vSalesPctChange)&lt;/P&gt;&lt;P&gt;Discount% = InputSum(UnitPriceInputDiscount)&lt;/P&gt;&lt;P&gt;Fee after Discount = sum(ExchangeFee*vSalesPctChange)*(1-(Discount%/100))&lt;/P&gt;&lt;P&gt;Payback = sum(PaybackAmount*vCostPctChange)&lt;/P&gt;&lt;P&gt;Margin = [Fee after Discount] - sum(PaybackAmount*vCostPctChange)&lt;/P&gt;&lt;P&gt;Margin% = [Margin]/sum(PaybackAmount*vCostPctChange)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Antoinette&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 13:52:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668919#M1082095</guid>
      <dc:creator />
      <dc:date>2014-06-27T13:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668920#M1082096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;PaybackAmount&lt;/SPAN&gt; and vCostPctChange &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why dont you just use &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;[Margin]/&lt;/SPAN&gt;[&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Payback&lt;/SPAN&gt;]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:08:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668920#M1082096</guid>
      <dc:creator />
      <dc:date>2014-06-27T14:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668921#M1082097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One can use Column(1) / Column(2) ... adding some more logic might be required for your exact calculation...but easy way to create a calculation. Otherwise - perhaps using some set analysis might be required?&lt;/P&gt;&lt;P&gt;There is a "Relative" option in the Expression tab in the chart properties that might be of use to you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668921#M1082097</guid>
      <dc:creator>Greg_Williams</dc:creator>
      <dc:date>2014-06-27T14:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668922#M1082098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried [Margin]/[Payback] and it stills gives me the 10%&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:29:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668922#M1082098</guid>
      <dc:creator />
      <dc:date>2014-06-27T14:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668923#M1082099</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;I've tried Column(1)/Column(2) and the relative option also doesn't work in my scenario.&lt;/P&gt;&lt;P&gt;Can you maybe give me an example of the set analysis?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:35:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668923#M1082099</guid>
      <dc:creator />
      <dc:date>2014-06-27T14:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668924#M1082100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you played with the Aggregation on the expression in the expression's tab? "Total Mode"&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-4951"&gt;Set Analysis: syntaxes, examples&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:43:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668924#M1082100</guid>
      <dc:creator>Greg_Williams</dc:creator>
      <dc:date>2014-06-27T14:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668925#M1082102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are using a Straight Table, you can try to change the Total Mode for the Margin% to Average. You can find the Total Mode by going to the Expressions tab, selecting Margin% and changing the Total Mode.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="61358" alt="TotalMode.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/61358_TotalMode.JPG.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 15:39:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668925#M1082102</guid>
      <dc:creator />
      <dc:date>2014-06-27T15:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668926#M1082104</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;Thanks for the useful doc.&amp;nbsp; I will work through it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 11:26:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668926#M1082104</guid>
      <dc:creator />
      <dc:date>2014-06-30T11:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Percentage Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668927#M1082106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for this.&amp;nbsp; It looks like it is working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 11:27:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Percentage-Calculation/m-p/668927#M1082106</guid>
      <dc:creator />
      <dc:date>2014-06-30T11:27:15Z</dc:date>
    </item>
  </channel>
</rss>

