Desktop productivity for business analysts and programmers

unique List based on layer

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 84
Accepted Solution

unique List based on layer

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

 

 

 

 

 

 

 


Accepted Solutions
Solution
‎08-27-2017 06:37 PM
Super User
Posts: 20,219

Re: unique List based on layer

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


All Replies
Super User
Posts: 20,219

Re: unique List based on layer

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. 

Frequent Contributor
Posts: 84

Re: unique List based on layer

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

Solution
‎08-27-2017 06:37 PM
Super User
Posts: 20,219

Re: unique List based on layer

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 310 views
  • 0 likes
  • 2 in conversation