<?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: Calculate Column % in Pivot Table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Calculate-Column-in-Pivot-Table/m-p/1855933#M1215876</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try like below&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sum(QTY) / sum(total&amp;lt;Type&amp;gt; QTY)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2021 09:37:23 GMT</pubDate>
    <dc:creator>MayilVahanan</dc:creator>
    <dc:date>2021-11-05T09:37:23Z</dc:date>
    <item>
      <title>Calculate Column % in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Column-in-Pivot-Table/m-p/1855860#M1215872</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have a table as below:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 144pt;" border="0" width="192" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; width: 48pt;"&gt;Category&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-left: none; width: 48pt;"&gt;Type&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" class="xl63" style="border-left: none; width: 48pt;"&gt;QTY&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;F&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;20&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;30&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;C&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;40&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;C&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;F&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="10px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD width="60.5167px" height="10px" class="xl63" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;
&lt;TD width="59.9333px" height="10px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;60&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;120&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;F&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;D&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;50&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;C&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;E&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="70.55px" height="15px" class="xl63" style="height: 15.75pt; border-top: none;"&gt;C&lt;/TD&gt;
&lt;TD width="60.5167px" height="15px" class="xl63" style="border-top: none; border-left: none;"&gt;F&lt;/TD&gt;
&lt;TD width="59.9333px" height="15px" align="right" class="xl63" style="border-top: none; border-left: none;"&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I made a pivot table (X:Type / Y:Category) , which sum the QTY like this:&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl65" style="height: 15.75pt; width: 48pt;"&gt;　&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;D&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl65" style="height: 15.75pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;70&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;132&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;　&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl65" style="height: 15.75pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;80&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;　&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;110&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl65" style="height: 15.75pt; border-top: none;"&gt;C&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;　&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;130&lt;/TD&gt;
&lt;TD class="xl65" style="border-top: none; border-left: none;"&gt;250&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then I would like to convert as %&amp;nbsp; by each column.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 192pt;" border="0" width="256" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD width="64" height="21" class="xl65" style="height: 15.75pt; width: 48pt;"&gt;　&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;D&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;E&lt;/TD&gt;
&lt;TD width="64" class="xl65" style="border-left: none; width: 48pt;"&gt;F&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl65" style="height: 15.75pt; border-top: none;"&gt;A&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;47%&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;50%&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;0%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl65" style="height: 15.75pt; border-top: none;"&gt;B&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;53%&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;0%&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;31%&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.75pt;"&gt;
&lt;TD height="21" class="xl65" style="height: 15.75pt; border-top: none;"&gt;C&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;0%&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;50%&lt;/TD&gt;
&lt;TD class="xl66" style="border-top: none; border-left: none;"&gt;69%&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried to use: sum(QTY) / sum(total QTY)&lt;/P&gt;
&lt;P&gt;but the part "sum(total QTY)" returns 772 (total of all QTY)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried and worked for hard code like:&lt;/P&gt;
&lt;P&gt;sum(TOTAL if(Type='D', QTY)),&lt;/P&gt;
&lt;P&gt;but if I get dynamic like:&lt;/P&gt;
&lt;P&gt;sum(TOTAL if(Type=subfield(type,',',1), QTY))&lt;/P&gt;
&lt;P&gt;it returns 772 again..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas? thanks&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 06:24:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Column-in-Pivot-Table/m-p/1855860#M1215872</guid>
      <dc:creator>deekey2</dc:creator>
      <dc:date>2021-11-05T06:24:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Column % in Pivot Table</title>
      <link>https://community.qlik.com/t5/QlikView/Calculate-Column-in-Pivot-Table/m-p/1855933#M1215876</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try like below&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sum(QTY) / sum(total&amp;lt;Type&amp;gt; QTY)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2021 09:37:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Calculate-Column-in-Pivot-Table/m-p/1855933#M1215876</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-11-05T09:37:23Z</dc:date>
    </item>
  </channel>
</rss>

