Any help would be appreciated.
I am looking to pull a weeks worth of data and get the rolling number of devices to accountsID's over a 24hr period and sort them with the highest count at the top. Hope that makes sense.
%let start = '01apr2021 00:00:00'dt;
%let end = '07apr2021 00:00:00'dt;
%let status = '14may2021 00:00:00'dt;
/* Base Data Query */
proc sql;
create table BaseQuery as
select ReportDate,
AccountID,
DeviceNumber,
datepart(CreateDate) format date9. as date,
timepart(CreateDate) format time8. as time,
TrackingNumber,
from my.database
where ReportDate between &start. and &end.
;
quit;
What do you mean by "rolling number of devices to accountsID's over a 24hr period"? Do you mean for every hour (or every minute, or every day) between &start and &end, you want the number of device records for the preceding 24 hours? If so, do you want this rolling number for each id, or accumulated over all id's?
Do you mean for every hour between &start and &end, you want the number of device records for the preceding 24 hours? yes
If so, do you want this rolling number for each id, or accumulated over all id's? Each ID
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.