BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,

I have come accross a problem regarding the computed columns from a tabulate procedure.

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.

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.

So, is there a way I can use conditionnal computed columns?

Thanks in advance.
2 REPLIES 2
ChrisNZ
Tourmaline | Level 20
Difficult to reply without the actual data, but this works, if that's what you want:
[pre]
data t;
CUS=1; ARREARS=1; INS=3; output;
CUS=1; ARREARS=1; INS=1; output;
CUS=2; ARREARS=1; INS=0; output;
run;
option nocenter formchar='|========================';
proc tabulate;
class CUS;
var ARREARS INS;
table CUS, ARREARS*sum INS*sum ARREARS*pctsum='Rate';
run;
===============================================================
| | ARREARS | INS | ARREARS |
| ========================================
| | Sum | Sum | Rate |
===============================================================
|CUS | | | |
======================== | | |
|1 | 2.00| 4.00| 50.00|
===============================================================
|2 | 1.00| 0.00| .|
===============================================================
deleted_user
Not applicable
Hello,

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.

Thank you very much.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 820 views
  • 0 likes
  • 2 in conversation