how to create a matrices, similar to pivot table

Reply
Frequent Contributor
Posts: 134

how to create a matrices, similar to pivot table

HI,

I have a table with 3 columns, something like this

City           Date      Revenue

Toronto     Feb 13     $4

Toronto     Feb 14     $5

Toronto     Feb 15     $6

New York  Feb 13     $2

New York  Feb 14     $1

New yotk   Feb 15     $10

I want an out put report, similar to a pivot table, with Dates at the top going across (left to Right) and City going vertically (top to bottom) and values in the middle... something like this

City     Feb 13      Feb 14     Feb 15

Toronto     $4          $5          $6

New York     $2       $1          $10

Please advice

Thanks in advance

Regular Contributor
Posts: 151

Re: how to create a matrices, similar to pivot table

Depending on how you want your report (SAS dataset or html, pdf, excel etc), then  PROC TRANSPOSE or PROC TABULATE will give you what you want.  The online documentation has plenty of suitable examples, given that your data is very simple.

Ask a Question
Discussion stats
  • 1 reply
  • 157 views
  • 0 likes
  • 2 in conversation