<?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 report and conditional count in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14901#M3330</link>
    <description>Hello all,&lt;BR /&gt;
          I am trying to build a cross tab report using proc report. In the report I need to get an overall count of records and a count of records with a field ='Y' and then display them next to each other. Let me show you how the data is and what the report should look like&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
r_type      b_type     r_amt    int_type      int_amt&lt;BR /&gt;
aaa            1111       $10          N             0&lt;BR /&gt;
aaa            1111       $30          Y             $10&lt;BR /&gt;
&lt;BR /&gt;
aaa             2222      $50          Y              $30&lt;BR /&gt;
&lt;BR /&gt;
bbbb            1111     $15          Y             $25&lt;BR /&gt;
&lt;BR /&gt;
My report needs to look like&lt;BR /&gt;
&lt;BR /&gt;
r_type             b_type     b_type_ct     b_type_sum    int_type_ct      int_amt_sum&lt;BR /&gt;
aaa                 1111           2                   $40               1                      $10&lt;BR /&gt;
aaa                  222            1                    $50              1                      $30&lt;BR /&gt;
bbb                  1111           1                   $15              1                      $25&lt;BR /&gt;
&lt;BR /&gt;
I Have been able to get the b_type_ct and b_type_sum I am using across to get those. But I don't know how to count only the rows with int_type='Y' and then get the sum of int_amt_sum for those rows. I am thinking I need to use some kind of compute block, Please can anyone give me some suggestions on how to do this,&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Shri</description>
    <pubDate>Mon, 11 Oct 2010 15:38:06 GMT</pubDate>
    <dc:creator>sks</dc:creator>
    <dc:date>2010-10-11T15:38:06Z</dc:date>
    <item>
      <title>Proc report and conditional count</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14901#M3330</link>
      <description>Hello all,&lt;BR /&gt;
          I am trying to build a cross tab report using proc report. In the report I need to get an overall count of records and a count of records with a field ='Y' and then display them next to each other. Let me show you how the data is and what the report should look like&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
r_type      b_type     r_amt    int_type      int_amt&lt;BR /&gt;
aaa            1111       $10          N             0&lt;BR /&gt;
aaa            1111       $30          Y             $10&lt;BR /&gt;
&lt;BR /&gt;
aaa             2222      $50          Y              $30&lt;BR /&gt;
&lt;BR /&gt;
bbbb            1111     $15          Y             $25&lt;BR /&gt;
&lt;BR /&gt;
My report needs to look like&lt;BR /&gt;
&lt;BR /&gt;
r_type             b_type     b_type_ct     b_type_sum    int_type_ct      int_amt_sum&lt;BR /&gt;
aaa                 1111           2                   $40               1                      $10&lt;BR /&gt;
aaa                  222            1                    $50              1                      $30&lt;BR /&gt;
bbb                  1111           1                   $15              1                      $25&lt;BR /&gt;
&lt;BR /&gt;
I Have been able to get the b_type_ct and b_type_sum I am using across to get those. But I don't know how to count only the rows with int_type='Y' and then get the sum of int_amt_sum for those rows. I am thinking I need to use some kind of compute block, Please can anyone give me some suggestions on how to do this,&lt;BR /&gt;
&lt;BR /&gt;
Thanks&lt;BR /&gt;
Shri</description>
      <pubDate>Mon, 11 Oct 2010 15:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14901#M3330</guid>
      <dc:creator>sks</dc:creator>
      <dc:date>2010-10-11T15:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Proc report and conditional count</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14902#M3331</link>
      <description>Hi:&lt;BR /&gt;
  This looks like a SUMMARY report -- but I do not see INT_TYPE on the report. Unless you put INT_TYPE on the report, it will be very hard to find the count for the INT_TYPE=Y. Is there a reason you don't want to see the count of the Y and the S or the total of the amount for the Y and the S???&lt;BR /&gt;
 &lt;BR /&gt;
   PROC REPORT can only count or "work with" items that are placed on the report row. Can you show the code that you've started with??? And any log messages that you've gotten?? &lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 12 Oct 2010 23:36:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14902#M3331</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-10-12T23:36:54Z</dc:date>
    </item>
    <item>
      <title>Proc report and conditional count</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14903#M3332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like an answer to this question too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But for now, I change the Y/N character column into 1/0 numeric column. IF&amp;nbsp; int_type = 'Y' THEN&amp;nbsp; int_type_flag = 1 ELSE 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I use this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc report data=in;&lt;/P&gt;&lt;P&gt;column r_type b_type int_type_flag;&lt;/P&gt;&lt;P&gt;define r_type b_type/ group;&lt;/P&gt;&lt;P&gt;define int_type_flag / analysis SUM;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 10:30:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14903#M3332</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2011-09-30T10:30:57Z</dc:date>
    </item>
    <item>
      <title>Proc report and conditional count</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14904#M3333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Can you show all the code that you are using so far, including the code that you have used to create int_type_flag???&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 19:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-and-conditional-count/m-p/14904#M3333</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-09-30T19:41:53Z</dc:date>
    </item>
  </channel>
</rss>

