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

Hi everyone, 

    I need some assistance with combining variables to create a new variable. What I HAVE:

Zipcode Week_Start.  Facility

88888.   4/7/2019.      1

77777.   4/7/2019.       1

88888.   4/7/2019.        1

66666.   4/7/2019.        2

55555.   4/7/2019.        3

77777.   4/14/2019.       1

88888.   4/14/2019.        1

66666.   4/14/2019.        2

66666.  4/14/2019.         2

55555.   4/14/2019.        3

 

Some Zipcodes are different (i.e. 77777 and 88888), but they are still associated with the same Facility. I want to be able to get a count of Zipcodes associated with each facility for each week_start. For example, what I WANT:

 

Week_Start.  Facility.  Count

04/07/2019.   1.          3

04/07/2019.    2.         1

04/07/2019.   3.           1

04/14/2019.  1            2

04/14/2019.   2.          2

04/14/2019.  3.           1

 

Thank you for any help you are able to provide! 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Using the answer from your previous thread

You just need to change the TABLE statement in PROC FREQ

 

tables week_start*facility/list;
--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

Using the answer from your previous thread

You just need to change the TABLE statement in PROC FREQ

 

tables week_start*facility/list;
--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 345 views
  • 0 likes
  • 2 in conversation