<?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 Proc Tabulate: Summary of two different rows in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99918#M28033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do a table with proc tabulate where I'm calculating different totals.&lt;/P&gt;&lt;P&gt;At the moment it looks like the following:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="3064" alt="proc_tab.PNG" class="jive-image-thumbnail jive-image" height="109" src="https://communities.sas.com/legacyfs/online/3064_proc_tab.PNG" width="1142" /&gt;&lt;/P&gt;&lt;P&gt;With the following code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;PROC TABULATE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;DATA=my.data&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;VAR SUM_A_KOST_J SUM_A_HB SUM_A_TB SUM_AUSGABEN_OEFFENTLICH;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;CLASS PERH_J / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;CLASS KAT1AG / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;TABLE /* Zeilendimension */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;PERH_J,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;/* Spaltendimension */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;(ALL='SUBTOTAL_1')*SUM_AUSGABEN_OEFFENTLICH&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;KAT1AG*SUM_AUSGABEN_OEFFENTLICH &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;(ALL='SUBTOTAL_2')*SUM_A_KOST_J&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;KAT1AG*SUM_A_KOST_J&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to add a row which calculates me the TOTAL of SUBTOTAL_1 and SUBTOTAL_2.&lt;/P&gt;&lt;P&gt;Is this possible? And how can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Feb 2013 15:03:11 GMT</pubDate>
    <dc:creator>meatmuffin</dc:creator>
    <dc:date>2013-02-06T15:03:11Z</dc:date>
    <item>
      <title>Proc Tabulate: Summary of two different rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99918#M28033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to do a table with proc tabulate where I'm calculating different totals.&lt;/P&gt;&lt;P&gt;At the moment it looks like the following:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="3064" alt="proc_tab.PNG" class="jive-image-thumbnail jive-image" height="109" src="https://communities.sas.com/legacyfs/online/3064_proc_tab.PNG" width="1142" /&gt;&lt;/P&gt;&lt;P&gt;With the following code:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;PROC TABULATE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;DATA=my.data&lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;VAR SUM_A_KOST_J SUM_A_HB SUM_A_TB SUM_AUSGABEN_OEFFENTLICH;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;CLASS PERH_J / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;CLASS KAT1AG / ORDER=UNFORMATTED MISSING;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;TABLE /* Zeilendimension */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;PERH_J,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;/* Spaltendimension */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;(ALL='SUBTOTAL_1')*SUM_AUSGABEN_OEFFENTLICH&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;KAT1AG*SUM_AUSGABEN_OEFFENTLICH &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;(ALL='SUBTOTAL_2')*SUM_A_KOST_J&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;KAT1AG*SUM_A_KOST_J&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;RUN;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I would like to add a row which calculates me the TOTAL of SUBTOTAL_1 and SUBTOTAL_2.&lt;/P&gt;&lt;P&gt;Is this possible? And how can I do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 15:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99918#M28033</guid>
      <dc:creator>meatmuffin</dc:creator>
      <dc:date>2013-02-06T15:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate: Summary of two different rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99919#M28034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you change Perh_J, to&lt;/P&gt;&lt;P&gt;Perh_J All='Total'&lt;/P&gt;&lt;P&gt;You will get the sum of 2011 and 2012 for all columns. If want &lt;STRONG&gt;only&lt;/STRONG&gt; Subtotal21 and Subtotal_2 summed then you're likely outside of proc tabulate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 15:44:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99919#M28034</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-02-06T15:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate: Summary of two different rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99920#M28035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One of the principles of using PROC TABULATE is that any one cell in the report can be based on just a single analysis variable.&amp;nbsp; So the answer is no, you can't do that using your current structure to the data.&amp;nbsp; However, if you were to preprocess your data and create a new analysis variable then it would be possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newvar = sum_ausgaben_offentlich + sum_a_kost_j;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then add NEWVAR to the VAR statement, and the rest would be fairly easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Feb 2013 15:58:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99920#M28035</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-02-06T15:58:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate: Summary of two different rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99921#M28036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the answers.&lt;/P&gt;&lt;P&gt;Unfortunately the structure of the data isn't so easy as it looks like while creating the proc tabulate.&lt;/P&gt;&lt;P&gt;Well, I have to search for a possible preprocess.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 14:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99921#M28036</guid>
      <dc:creator>meatmuffin</dc:creator>
      <dc:date>2013-02-08T14:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Tabulate: Summary of two different rows</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99922#M28037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In that case, here's a similar approach that might work.&amp;nbsp; Instead of printing the report with PROC TABULATE, create an output data set instead.&amp;nbsp; Then modify the output data set and use that as the input to a second PROC TABULATE to actually print the report.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2013 17:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Tabulate-Summary-of-two-different-rows/m-p/99922#M28037</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-02-08T17:34:17Z</dc:date>
    </item>
  </channel>
</rss>

