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

Hello, I have a dataset with 30k observations. I currently do this operation in excel PivotTables every week but I would love to automate this.

 

The dataset looks something like this: (I can't show the actual dataset for privacy reasons)

date | location | dosages | other_columns_i_want_to_ignore
... 11/17/21 | A | 3 11/17/21 | B | 2
11/17/21 | C | 80 11/18/21 | A | 1 11/18/21 | B | 5
11/18/21 | C | 3 11/19/21 | A | 3 11/19/21 | B | 10
11/19/21 | C | 1
...

I would like to consolidate this into a table like this:

location | dosages |
A | 7
B | 17
C | 84

Thanks again for all your help!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc summary data=have nway;
    class location;
    var dosages;
    output out=want sum=;
run;
--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
proc summary data=have nway;
    class location;
    var dosages;
    output out=want sum=;
run;
--
Paige Miller
heyyou1
Fluorite | Level 6
That works amazing! Thank you @PaigeMiller, you have been a lifesaver these past few days.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 543 views
  • 0 likes
  • 2 in conversation