The SAS Output Delivery System and reporting techniques

Crosstab report with calculated column

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

Crosstab report with calculated column

Hi,

 

I have the following dataset:

 

data have;
        input Skillset $        Year        Offered        Answered        Abandoned;
        cards;
SKILL1 2014 1116 952 164
SKILL1 2015 1579 977 602
SKILL1 2016 1475 936 539
SKILL2 2014 1422 876 546
SKILL2 2015 1545 810 735
SKILL2 2016 1200 988 212
SKILL3 2014 1332 855 477
SKILL3 2015 1071 836 235
SKILL3 2016 1020 837 183
;
run;

 

Is it possible to create a report in SAS 9.2 with year down the side, skillets going across the top, then within each skill set the a column for offered, answered, abandoned and also a calculated column PCA which is answered/offered as a percentage. 

 

See attachment for desired report.

 

Thanks for any help,

 

cxkev

Attachment

Accepted Solutions
Solution
‎01-17-2017 04:40 PM
SAS Super FREQ
Posts: 8,645

Re: Crosstab report with calculated column

Hi:

Yes, you can do this kind of crosstab report using PROC REPORT and ACROSS items. This paper http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf  discusses using ACROSS items, absolute column numbers and COMPUTE blocks -- starting on page 9 approximately.

  Here is an example using SASHELP.SHOES with 3 rows (1 for each region) and 2 PRODUCTS shown on report #1, then report #2 code illustrates how the absolute column numbers need to be used for the calculated column.

 

cynthia

show_abs_col.png

 

 

 

 

View solution in original post


All Replies
Frequent Contributor
Posts: 117

Re: Crosstab report with calculated column

can you paste the picture in message itself, I am unable to download it.
Contributor
Posts: 23

Re: Crosstab report with calculated column

Screenshot_20170117-110509.png

Solution
‎01-17-2017 04:40 PM
SAS Super FREQ
Posts: 8,645

Re: Crosstab report with calculated column

Hi:

Yes, you can do this kind of crosstab report using PROC REPORT and ACROSS items. This paper http://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf  discusses using ACROSS items, absolute column numbers and COMPUTE blocks -- starting on page 9 approximately.

  Here is an example using SASHELP.SHOES with 3 rows (1 for each region) and 2 PRODUCTS shown on report #1, then report #2 code illustrates how the absolute column numbers need to be used for the calculated column.

 

cynthia

show_abs_col.png

 

 

 

 

Contributor
Posts: 23

Re: Crosstab report with calculated column

Thank you very much for your help Cynthia
Post a Question
Discussion Stats
  • 4 replies
  • 216 views
  • 1 like
  • 3 in conversation