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
Check out SAS Innovate on-demand content! Watch the main stage sessions, keynotes, and over 20 technical breakout sessions!
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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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