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

Hello,

 

I am creating a code to view the district position and soil type. I wanted to create a count for the soil type so instead of the data being like this:

 

DistrictPosition SoilID SoilName

           S                 838       Prior

           N                 802     Liverpool

           N                 802     Liverpool

           N                 802     Liverpool

           N                 803     Brosnan

 

To this: I need to remove soilname, I am running a dataset with 3775 lines but condensed it to just the 5.

 

DistrictPosition SoilID  Count

           S                 838        1

           N                 802        3

           N                 803        1

 

Hopefully this is possible,

 

I appreciate the help!

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

proc sql;

select DistrictPosition ,SoilID , n(SoilName) as count

from your_data

group by DistrictPosition ,SoilID;

quit;  

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

proc sql;

select DistrictPosition ,SoilID , n(SoilName) as count

from your_data

group by DistrictPosition ,SoilID;

quit;  

cassylovescats
Calcite | Level 5

Thank you! It is extremely appreciated! This is for a final presentation for school.