Desktop productivity for business analysts and programmers

Crosstab Report with different data fields

Reply
Regular Contributor
Posts: 152

Crosstab Report with different data fields

Hello

When producing reports in EG they only allow for a all of the same data elements down the left side but what if you want different data elements?

For instance, currently the data is selected and presented as
Fiscal Year
Q1 Q2 Q3 Q4 Total
Procedure 1 5 6 7 8 26
Procedure 2 4 4 4 5 17


What I would like to see is:

Fiscal Year
Q1 Q2 Q3 Q4 Total
Total Cases 5 5 5 5 20
Total Days 10 20 30 10 70
Total ALC Days 5 3 5 4 17

Is this possible? Thanks.
SAS Employee
Posts: 149

Re: Crosstab Report with different data fields

This is absolutely doable. Probably the best tool would be the Summary Tables task, which will let you summarize information by rows and columsn. Start with the Summary Tables wizard to set things up (much easier), then right-click on the task and select Open in Advanced View. This will bring up the Summary Tables task in a dialog interface, and from the Tables pane you can right-click on the parts of the report preview you want to change.

This is a little bit older paper which doesn't go into the wizard, but might be helpful for getting started:
http://www2.sas.com/proceedings/sugi31/144-31.pdf

Richard
Regular Contributor
Posts: 152

Re: Crosstab Report with different data fields

HI Richard

Thanks very much.

The document you provided doesn't look like what I am requesting. For instance in their examples they take the field of country and show countries down the left hand side and # of cases (or whatever calculation you want) in the rows with whatever timeframe/criterion that you put in the rows.

I want a different field on the left hand side so basically it would be a "page" group of countries but for Canada there would be:
Total Cases
Total Days
Average Days

(though this is just an example - I don't actually require page groups)
etc.

Is that possible in EG (because to code in ODS would probably be very laborious).

Thanks. Message was edited by: shellp55
SAS Employee
Posts: 149

Re: Crosstab Report with different data fields

Probably need to use the Summary Tables task, rather than the wizard, to start this off. I was playing with SASHELP.CLASS since most everyone has a SASHELP library with some practice data sets like this.

Data pane: analysis variables of Age, Height, Weight. Classification variable of Sex. Notice you could have pages, if you wanted.

Summary Tables pane: this requires a little playing around with the elements in the preview... but hey, it's faster than writing the PROC TAB code. I first dragged Age, Height, Weight into the rows. Then I dragged Sex into the columns above the Sum statistic (which was automatically added as soon as I dragged over the first group). Then I dragged Sum from available statistics to the left of Age in the rows to get EG to move the statistic label into the rows. To change the rows to display things like "Total Cases", you'd just right click on the headers in the Summary Tables pane and choose heading properties to modify it.

That work for you?
Ask a Question
Discussion stats
  • 3 replies
  • 1730 views
  • 0 likes
  • 2 in conversation