matrix report

Accepted Solution Solved
Reply
Contributor
Posts: 35
Accepted Solution

matrix report

Hi,

I have a dataset with this layout.

HAVE:

PROVIDER      MEMBER      AMOUNT

provider1          memberA             1000

provider2          memberA               100

provider1          memberB           10000

provider3          memberB                 10

provider4          memberC         100000

provider4          memberD               100

How do I reshape to create a report like the one below?

WANT:

PROVIDER      memberA      memberB      memberC      memberD

provider1                  1000           10000 

provider2                    100  

provider3                                           10 

provider4                                                         100000               100


Accepted Solutions
Solution
‎02-07-2014 06:45 PM
Valued Guide
Posts: 2,177

Re: matrix report

Proc tabulate missing data= your.data format= 6.0 ;

Class provider member ;

var amount ;

Table provider, member=' '*sum= ' ' / rts=10 ;

Run ;

View solution in original post


All Replies
Solution
‎02-07-2014 06:45 PM
Valued Guide
Posts: 2,177

Re: matrix report

Proc tabulate missing data= your.data format= 6.0 ;

Class provider member ;

var amount ;

Table provider, member=' '*sum= ' ' / rts=10 ;

Run ;

Super User
Posts: 11,343

Re: matrix report

may want to include

misstext=' '

after rts=10.

Contributor
Posts: 35

Re: matrix report

Thank you for the replies.

I got the error below when I ran the code though.

1336  Proc tabulate missing data=task format= 6.0 ;
1337
1338  Class provider member ;
1339
1340  var amount ;
1341
1342  Table provider, member=' '*sum= ' ' / rts=10 misstext=' ';
1343
1344  Run ;

ERROR: Statistic other than N was requested without analysis variable in the following nesting
       : PROVIDER * MEMBER * Sum.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE TABULATE used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


Super User
Posts: 19,772

Re: matrix report

Proc tabulate missing data= have format= 6.0 ;

Class provider member ;

var amount ;

Table provider, member=' '*amount*sum= ' ' / rts=10 misstext=' ';

Run ;

Contributor
Posts: 35

Re: matrix report

Thanks.

Is there a way to collapse repeating values of the PROVIDER column?  Please see attached.

proc tabulate.png

Occasional Contributor
Posts: 13

Re: matrix report

Your report shows a line for "prodiver1" and a line for "provider1" -- note the spelling. I think that might be it.

Contributor
Posts: 35

Re: matrix report

That was it.  Thank you, and good eye.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 614 views
  • 6 likes
  • 5 in conversation