BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
crawfe
Quartz | Level 8

Hi, I am a relatively new EG user (moving to also use DI later this year hopefully so DI comments are welcome also).

I understand how to do a Summary Grouping of one variable (by Country-Site-Month etc.) using the bottom window.

Is it possible to do different summary groupings in a single step? It seems inefficient to have to

create a new step for every different group. For example, create columns for (group by) COUNT by Country-Site-Month and then COUNT by Country-Site in the same project step. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

Boy have I got a task for you!

 

Here's an industrial-strength summarization engine, thanks to PROC MEANS.

 

From Enterprise Guide:

  1. Open the dataset you want to summarize (I'm using SASHELP.SHOES as an example).
  2. Select Describe -> Summary Statistics
  3. On the Data tab, pull the variables you want to summarize into "Classification Variables". I used Region, Product, and Subsidiary.
  4. On the Data tab, Pull one numeric variable into "Analysis Variables" (that's the only downside, you need one numeric variable, even though you don't use it for anything.) Make sure it's always non-null.
  5. On the "Statistics" "Basic" tab, untick everything except "Number of Observations".
  6. On the "Results" tab, untick "Show Statistics", and tick "Save statistics to data set". That will give you a summary dataset. Set "Combinations of classification variables" to "All ways".
  7. Click "Run".

 

You'll get a dataset that will show all of the 0-way (summary for the dataset), 1-way (Region, and 2 others), 2-way (Region by Product, and two others) and 3-way (all three variables) summarizations of the data.

 

Tom

View solution in original post

2 REPLIES 2
TomKari
Onyx | Level 15

Boy have I got a task for you!

 

Here's an industrial-strength summarization engine, thanks to PROC MEANS.

 

From Enterprise Guide:

  1. Open the dataset you want to summarize (I'm using SASHELP.SHOES as an example).
  2. Select Describe -> Summary Statistics
  3. On the Data tab, pull the variables you want to summarize into "Classification Variables". I used Region, Product, and Subsidiary.
  4. On the Data tab, Pull one numeric variable into "Analysis Variables" (that's the only downside, you need one numeric variable, even though you don't use it for anything.) Make sure it's always non-null.
  5. On the "Statistics" "Basic" tab, untick everything except "Number of Observations".
  6. On the "Results" tab, untick "Show Statistics", and tick "Save statistics to data set". That will give you a summary dataset. Set "Combinations of classification variables" to "All ways".
  7. Click "Run".

 

You'll get a dataset that will show all of the 0-way (summary for the dataset), 1-way (Region, and 2 others), 2-way (Region by Product, and two others) and 3-way (all three variables) summarizations of the data.

 

Tom

crawfe
Quartz | Level 8

That is pretty cool. For three columns, it gives you all possible two-way summaries also.

I am going to have to see how I can use it. Thanks!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1472 views
  • 1 like
  • 2 in conversation