{"id":4748,"date":"2012-08-20T13:27:30","date_gmt":"2012-08-20T18:27:30","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/legacy\/?page_id=4748"},"modified":"2017-06-12T14:36:57","modified_gmt":"2017-06-12T19:36:57","slug":"margin-calculations-within-pivot-tables","status":"publish","type":"page","link":"https:\/\/www.mrc-productivity.com\/legacy\/reports\/margin-calculations-within-pivot-tables","title":{"rendered":"Margin Calculations within Pivot Tables"},"content":{"rendered":"<p><!-- Begin Content --><\/p>\n<h1>Margin Calculations within Pivot Tables<\/h1>\n<p>Pivot Tables offer increased runtime functionality for end-users without requiring heavy customization by developers. While Pivot Tables are easy to use, one common question received is \u201cHow can I add runtime calculations to my subtotal and grand total levels?\u201d<\/p>\n<p>To do so, begin by creating your Pivot Table as normal, being sure to select as many sequence keys and record selections as needed. Below is a sample Pivot Table:<\/p>\n<p><img decoding=\"async\" class=\"border\" alt=\"\" src=\"\/legacy\/images\/margincalcs1.jpg\" \/><\/p>\n<p>In the example above, we want to see what percent of total sales was spent on cost of goods sold. To accomplish this, navigate to calculations and add a new calculation, as shown below:<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"\/legacy\/images\/margincalcs2.jpg\" \/><\/p>\n<p>What is important to note is that the Calc Type is set to \u201cApplication\u201d. Selecting application as the type within Pivot Tables will create a margin calculation automatically at runtime. After adding this calculation, be sure to compile\/recompile. Now, at runtime, the margin calc can be selected and displayed, just like all other non-sequence key, displayed numeric fields:<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"\/legacy\/images\/margincalcs3.jpg\" \/><\/p>\n<p><!-- End Content --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Margin Calculations within Pivot Tables Pivot Tables offer increased runtime functionality for end-users without requiring heavy customization by developers. While Pivot Tables are easy to use, one common question received is \u201cHow can I add runtime calculations to my subtotal and grand total levels?\u201d To do so, begin by creating your Pivot Table as normal, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":557,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4748","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/4748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/comments?post=4748"}],"version-history":[{"count":8,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/4748\/revisions"}],"predecessor-version":[{"id":6821,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/4748\/revisions\/6821"}],"up":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/557"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/media?parent=4748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}