<?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 conditionnal computed columns. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65791#M18756</link>
    <description>Difficult to reply without the actual data, but this works, if that's what you want:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data t;&lt;BR /&gt;
  CUS=1; ARREARS=1; INS=3; output;&lt;BR /&gt;
  CUS=1; ARREARS=1; INS=1; output;&lt;BR /&gt;
  CUS=2; ARREARS=1; INS=0; output;&lt;BR /&gt;
run;&lt;BR /&gt;
option nocenter formchar='|========================';&lt;BR /&gt;
proc tabulate;&lt;BR /&gt;
  class CUS;&lt;BR /&gt;
  var ARREARS INS;&lt;BR /&gt;
  table CUS, ARREARS*sum INS*sum ARREARS*pctsum&lt;INS&gt;='Rate';&lt;BR /&gt;
run;&lt;BR /&gt;
===============================================================&lt;BR /&gt;
|                      |  ARREARS   |    INS     |  ARREARS   |&lt;BR /&gt;
|                      ========================================&lt;BR /&gt;
|                      |    Sum     |    Sum     |    Rate    |&lt;BR /&gt;
===============================================================&lt;BR /&gt;
|CUS                   |            |            |            |&lt;BR /&gt;
========================            |            |            |&lt;BR /&gt;
|1                     |        2.00|        4.00|       50.00|&lt;BR /&gt;
===============================================================&lt;BR /&gt;
|2                     |        1.00|        0.00|           .|&lt;BR /&gt;
===============================================================&lt;/INS&gt;</description>
    <pubDate>Thu, 20 Aug 2009 21:18:22 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2009-08-20T21:18:22Z</dc:date>
    <item>
      <title>PROC TABULATE conditionnal computed columns.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65790#M18755</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I have come accross a problem regarding the computed columns from a tabulate procedure.&lt;BR /&gt;
&lt;BR /&gt;
Basically, I would like column "Arrears Rate" to be calculated as "Arrears" / "Total Insured Amount" in each row of the table, but ONLY when there is an Insured Amount.  If there are none, I would like the cell to be either empty or have a dot.&lt;BR /&gt;
&lt;BR /&gt;
I've tried the conditionnal approach with IF statements (in the code itself or by running a summary table automated procedure from SAS EG).  Nothing worked.&lt;BR /&gt;
&lt;BR /&gt;
So, is there a way I can use conditionnal computed columns?  &lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance.</description>
      <pubDate>Thu, 20 Aug 2009 17:06:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65790#M18755</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-20T17:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE conditionnal computed columns.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65791#M18756</link>
      <description>Difficult to reply without the actual data, but this works, if that's what you want:&lt;BR /&gt;
[pre]&lt;BR /&gt;
data t;&lt;BR /&gt;
  CUS=1; ARREARS=1; INS=3; output;&lt;BR /&gt;
  CUS=1; ARREARS=1; INS=1; output;&lt;BR /&gt;
  CUS=2; ARREARS=1; INS=0; output;&lt;BR /&gt;
run;&lt;BR /&gt;
option nocenter formchar='|========================';&lt;BR /&gt;
proc tabulate;&lt;BR /&gt;
  class CUS;&lt;BR /&gt;
  var ARREARS INS;&lt;BR /&gt;
  table CUS, ARREARS*sum INS*sum ARREARS*pctsum&lt;INS&gt;='Rate';&lt;BR /&gt;
run;&lt;BR /&gt;
===============================================================&lt;BR /&gt;
|                      |  ARREARS   |    INS     |  ARREARS   |&lt;BR /&gt;
|                      ========================================&lt;BR /&gt;
|                      |    Sum     |    Sum     |    Rate    |&lt;BR /&gt;
===============================================================&lt;BR /&gt;
|CUS                   |            |            |            |&lt;BR /&gt;
========================            |            |            |&lt;BR /&gt;
|1                     |        2.00|        4.00|       50.00|&lt;BR /&gt;
===============================================================&lt;BR /&gt;
|2                     |        1.00|        0.00|           .|&lt;BR /&gt;
===============================================================&lt;/INS&gt;</description>
      <pubDate>Thu, 20 Aug 2009 21:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65791#M18756</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-08-20T21:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: PROC TABULATE conditionnal computed columns.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65792#M18757</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I'm sorry I didn't put enough information in my previous post.  Good news though : I got the general idea of what you suggested to do and it worked fine on my end.&lt;BR /&gt;
&lt;BR /&gt;
Thank you very much.</description>
      <pubDate>Fri, 21 Aug 2009 15:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-TABULATE-conditionnal-computed-columns/m-p/65792#M18757</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-21T15:07:13Z</dc:date>
    </item>
  </channel>
</rss>

