<?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: Multiple Filter within a proc-tabulate-step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832464#M329045</link>
    <description>&lt;P&gt;thank you for your answers. pretty helpful! that works!&lt;/P&gt;
&lt;P&gt;Ive another question: I guess, proc tabulate doenst know such thing like "select distinct" for a specific column?&lt;/P&gt;</description>
    <pubDate>Fri, 09 Sep 2022 10:49:44 GMT</pubDate>
    <dc:creator>Konkordanz</dc:creator>
    <dc:date>2022-09-09T10:49:44Z</dc:date>
    <item>
      <title>Multiple Filter within a proc-tabulate-step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832286#M328953</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two proc-tabulate-steps with separate where-filters. But actually I want just 1 table with the results of both tables:&lt;/P&gt;
&lt;P&gt;Col2: bev&lt;/P&gt;
&lt;P&gt;Col3:&amp;nbsp;FPSchl*betrag where FPSchl="P9999"&lt;/P&gt;
&lt;P&gt;col4: FPSchl*betrag&amp;nbsp;where FPSchl="P1999";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So: Is this within one proc-tabulate-step doable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc tabulate data=Schulden out=test;
class namebst  fpschl;
var betrag bev;
table NameBST, bev FPSchl*betrag;
where FPSchl="P9999";
run;

proc tabulate data=Schulden out=test2;
class namebst  fpschl;
var betrag bev;
table NameBST, bev FPSchl*betrag;
where FPSchl="P1999";
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Sep 2022 10:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832286#M328953</guid>
      <dc:creator>Konkordanz</dc:creator>
      <dc:date>2022-09-08T10:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Filter within a proc-tabulate-step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832290#M328954</link>
      <description>&lt;P&gt;Seems to me it is this simple?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc tabulate data=Schulden out=test;
class namebst  fpschl;
var betrag bev;
table NameBST, bev FPSchl*betrag;
where FPSchl in ("P9999", "P1999");
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Sep 2022 11:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832290#M328954</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-08T11:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Filter within a proc-tabulate-step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832328#M328966</link>
      <description>&lt;P&gt;Depends on exactly what you expect for the results of other variables such as BEV. If you want BEV to have separate sums that match your separate tables then likely you could do:&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=Schulden out=test;
class namebst  fpschl;
var betrag bev;
table NameBST, FPSchl*(BEV betrag);
where FPSchl in ("P9999", "P1999");
run;&lt;/PRE&gt;
&lt;P&gt;You can nest and group lots of variables and statistics requests with ( ) for the groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is best to either provide example data or use a SAS supplied data set for your examples. Here is similar code using the SASHELP.CLASS data set.&lt;/P&gt;
&lt;PRE&gt;proc tabulate data=sashelp.class;
class sex  age;
var height weight;
table sex, weight age*height;
where age=13;
run;

proc tabulate data=sashelp.class ;
class sex  age;
var height weight;
table sex, weight age*height;
where age=14;
run;

proc tabulate data=sashelp.class ;
class sex  age;
var height weight;
table sex,  age*(weight height);
where age in (13, 14);
run;

&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 15:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832328#M328966</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-09-08T15:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Filter within a proc-tabulate-step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832464#M329045</link>
      <description>&lt;P&gt;thank you for your answers. pretty helpful! that works!&lt;/P&gt;
&lt;P&gt;Ive another question: I guess, proc tabulate doenst know such thing like "select distinct" for a specific column?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 10:49:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Filter-within-a-proc-tabulate-step/m-p/832464#M329045</guid>
      <dc:creator>Konkordanz</dc:creator>
      <dc:date>2022-09-09T10:49:44Z</dc:date>
    </item>
  </channel>
</rss>

