<?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: Proc tabulate-2 class vars and 1 measurement var in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827831#M326992</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;, good job describing the problem and your attempts to solve it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;, good solution, but I think you can get by without creating a new variable (but by shuffling pieces of the TABLE statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=have;
class team p position;
var points;
table team='' All, p=''*(
(position='' all)* N 
(position='' all)*points=''*SUM 
)/misstext='0' box='Team';
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=have;
class team position;
var points;
table team='' All, points='Points by Position' * (
(position='' all)* N 
(position='' all)*SUM 
)/misstext='0' box='Team';
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I left the longer label in place for POINTS, rather than trying to explain it.&amp;nbsp; But it can easily be shortened.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Aug 2022 12:54:35 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2022-08-09T12:54:35Z</dc:date>
    <item>
      <title>Proc tabulate-2 class vars and 1 measurement var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827768#M326968</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I want to perform proc tabulate with 2 class variables and 1 measurement variable.&lt;/P&gt;
&lt;P&gt;I want to modify the report and get the following:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ronein_0-1660032462566.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74267i81BBAD4CE0633D1D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ronein_0-1660032462566.png" alt="Ronein_0-1660032462566.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What is the way to do it please?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input team $ position $ points;
cards;
A Guard 15
A Guard 12
A Guard 29
A Forward 13
A Forward 9
A Forward 16
B Guard 25
B Guard 20
C Guard 34
C Forward 19
C Forward 3
C Forward 8
;
run;

Title 'Distribution-N/SUM of points';
proc tabulate data=have;
class team position;
var points;
table team='' All, position * points='' * (N SUM) /misstext='0' box='Team';
run; 
 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Aug 2022 08:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827768#M326968</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-08-09T08:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-2 class vars and 1 measurement var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827819#M326987</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input team $ position $ points;
p='position';
cards;
A Guard 15
A Guard 12
A Guard 29
A Forward 13
A Forward 9
A Forward 16
B Guard 25
B Guard 20
C Guard 34
C Forward 19
C Forward 3
C Forward 8
;
run;

Title 'Distribution-N/SUM of points';
proc tabulate data=have;
class team p position;
var points;
table team='' All, p=''*(
(position='' all)* N 
(position='' all)*points=''*SUM 
)/misstext='0' box='Team';
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1660048052736.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74278iFDFFA5532E790339/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1660048052736.png" alt="Ksharp_0-1660048052736.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 12:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827819#M326987</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-09T12:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-2 class vars and 1 measurement var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827831#M326992</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;, good job describing the problem and your attempts to solve it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;, good solution, but I think you can get by without creating a new variable (but by shuffling pieces of the TABLE statement).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=have;
class team p position;
var points;
table team='' All, p=''*(
(position='' all)* N 
(position='' all)*points=''*SUM 
)/misstext='0' box='Team';
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Try it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=have;
class team position;
var points;
table team='' All, points='Points by Position' * (
(position='' all)* N 
(position='' all)*SUM 
)/misstext='0' box='Team';
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I left the longer label in place for POINTS, rather than trying to explain it.&amp;nbsp; But it can easily be shortened.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 12:54:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827831#M326992</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-08-09T12:54:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-2 class vars and 1 measurement var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827845#M326998</link>
      <description>Thanks&lt;BR /&gt;May you please explain what is the meaning of p? As i see it is a new variable that you defined?</description>
      <pubDate>Tue, 09 Aug 2022 13:22:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827845#M326998</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-08-09T13:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Proc tabulate-2 class vars and 1 measurement var</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827853#M327001</link>
      <description>p has value 'position' for all the obs, It is a dummy variable to make the top header 'position'.</description>
      <pubDate>Tue, 09 Aug 2022 13:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-tabulate-2-class-vars-and-1-measurement-var/m-p/827853#M327001</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-09T13:35:57Z</dc:date>
    </item>
  </channel>
</rss>

