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.

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

Explore Now →
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
  • 1465 views
  • 0 likes
  • 2 in conversation