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
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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