BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have table that I want to create summary value that I can easily do in Excel Pivot table .. but how can I acheive this goal in Enterprise guide ?

Month is_yes
a 1
a 0
a 1
b 1
b 0

how can I create table summary of

Month is_yes_by_month N(count)
a 33.33% 3
b 50% 2
2 REPLIES 2
ChrisHemedinger
Community Manager
You can use the Query Builder to create a calculated column (or two) based on is_yes. SUM, AVG, COUNT DISTINCT are all built-in summarizations.

The Query Builder (in 4.2 and later) will automatically group the results by the remaining column (Month), so your result with have the summarized answers, one record per Month value.

Chris
SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello IamJeannie,

If you are not against coding and SQL in EG, you can use the following code:
[Pre]
data a;
input Month $1 Is_Yes;
datalines;
a 1
a 0
a 1
b 1
b 0
;
run;
/* Result */;
proc SQL;
create table r as
select Month, 1-SUM(Is_Yes)/COUNT(*) as Is_Yes_by_Month format=Percent7.2,
COUNT(*) as N
from a
group by Month
;quit;
[/Pre]
Sincerely,
SPR

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 735 views
  • 0 likes
  • 3 in conversation