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
Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 853 views
  • 0 likes
  • 3 in conversation