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

Hi All,

 

Apologies for this basic question just not sure how best to do it.

 

I need to get a unique list of the variable 'Queue' by the variable 'Layer.

 

My data looks like this (has a date range of from 01/08/2017 to current)

 

WEEK_END_DTClusterQueueLayer
8/01/2017FAPADFUnknown
8/01/2017FAPCCBExtended
8/01/2017FAPCSAAssisted
8/01/2017FAPCSAUnknown
8/01/2017FAPCSAUnknown
8/01/2017FAPCSAUnknown
8/01/2017FAPCSAUnknown
8/01/2017FAPCSAUnknown
8/01/2017FAPCSAUnknown
8/01/2017FAPECFUnknown
8/01/2017FAPF04Assisted
8/01/2017FAPF06Extended
8/01/2017FAPF07Unknown
8/01/2017FAPF10General
8/01/2017FAPF13General
8/01/2017FAPF18General
8/01/2017FAPF20General
8/01/2017FAPF21Unknown

 

and would like the output to look like this:

LayerQueue
AssistedCSA
 F04
ExtendedCCB
 F06
GeneralF10
 F13
 F18
 F20
UnknownADF
 CSA
 CSA
 CSA
 CSA
 CSA
 CSA
 ECF
 F07
 F21

 

Hope this makes sense.

 

Cheers

 

Dean

 

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

PROC SORT with NODUPKEY and/or PROC REPORT. I'm not sure if PROC REPORT will accomplish this directly but I'd try that first, or use PROC SORT and then use that output with PROC REPORT. 

 

Not exactly your question but close:

https://github.com/statgeek/SAS-Tutorials/blob/master/count_distinct_by_group

View solution in original post

3 REPLIES 3
Reeza
Super User

Are you programming or using the GUI? 

 

If GUI select the two columns and check the distinct box. 

Or, look at the sort task, and there's an option for no duplicates which will be the same idea. 

Third - a summary task - but these will give you a count, so you'll know how many fall into each category. 

DME790
Pyrite | Level 9

Hi Reeza,

 

Thanks for the quick response.

 

I'm programming and not sure which Proc to use to get the result. will a proc tabulate do what I need even if it doesn't have a variable?

 

Cheers

Reeza
Super User

PROC SORT with NODUPKEY and/or PROC REPORT. I'm not sure if PROC REPORT will accomplish this directly but I'd try that first, or use PROC SORT and then use that output with PROC REPORT. 

 

Not exactly your question but close:

https://github.com/statgeek/SAS-Tutorials/blob/master/count_distinct_by_group

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 1200 views
  • 0 likes
  • 2 in conversation