Hi,
I have a dataset consisting: customers, food vendors, and order date .
Since customers can order from multiple food vendors within the same day, I need to figure out the frequencies and %'s of Vender A,B,C,etc. being ordered together within the same day.
dataset:
Name Vendor Order_date
Bob A 1-1-2020
Bob A 1-1-2020
Bob B 1-1-2020
Joe A 1-2-2020
Joe B 1-2-2020
Chris A 1-1-2020
Chris B 1-2-2020
David C 1-3-2020
David A 1-3-2020
David B 1-3-2020
want:
Vendor_comb count
A, B 3
bc Vendor A & B were ordered 3 times within the same day from Bob, Joe, David. Chris does not count bc he ordered on different days. Thanks
Try something like:
Proc freq data=have;
tables order_date*vendor / list ;
run;
Incomplete description gives incomplete code.
Show ALL of the output you actually expect given your example data. As it should appear.
You show NO records with both A and B, so your date will need some serious rearranging, and you likely should show the intermediate step so that 'combinations of A and B' exist.
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 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: