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_DT | Cluster | Queue | Layer |
8/01/2017 | FAP | ADF | Unknown |
8/01/2017 | FAP | CCB | Extended |
8/01/2017 | FAP | CSA | Assisted |
8/01/2017 | FAP | CSA | Unknown |
8/01/2017 | FAP | CSA | Unknown |
8/01/2017 | FAP | CSA | Unknown |
8/01/2017 | FAP | CSA | Unknown |
8/01/2017 | FAP | CSA | Unknown |
8/01/2017 | FAP | CSA | Unknown |
8/01/2017 | FAP | ECF | Unknown |
8/01/2017 | FAP | F04 | Assisted |
8/01/2017 | FAP | F06 | Extended |
8/01/2017 | FAP | F07 | Unknown |
8/01/2017 | FAP | F10 | General |
8/01/2017 | FAP | F13 | General |
8/01/2017 | FAP | F18 | General |
8/01/2017 | FAP | F20 | General |
8/01/2017 | FAP | F21 | Unknown |
and would like the output to look like this:
Layer | Queue |
Assisted | CSA |
F04 | |
Extended | CCB |
F06 | |
General | F10 |
F13 | |
F18 | |
F20 | |
Unknown | ADF |
CSA | |
CSA | |
CSA | |
CSA | |
CSA | |
CSA | |
ECF | |
F07 | |
F21 |
Hope this makes sense.
Cheers
Dean
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
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.
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
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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.