I want to run a query based on the logic below:
If t1.PlayerDayDate=t2.NewEnrollmentDate then get the next three days of t1.PlayerDayDate of that respective patron.
I want to see when a customer enrolled on that day and play (hence playdate=new enrollmentdate) then also get the next three days transaction or play days.
Thanks
I hope this can be done in EG. Assuming both your dates are datetimes, use INTCK to count the number of days between play and enrolment :
proc sql;
create table nextDays as
select t2.newEnrolmentDate, t1.*
from
PlayerDays as t1 inner join
Enrolments as t2 on
t1.guestNumber=t2.guestNumber and
intck("DTDAY", t2.newEnrolmentDate, t1.PlayerDayDate) between 0 and 3;
quit;
(untested)
PG
You should provide a couple of small example data sets and what the desired output would look like.
Hi,
Below are the results of filtering t1.PlayerDayDate=t2.NewEnrollmentDate. Now I want the next three PlayerDayDate since the day that they enrolled.
Data are taken from WORK.QUERY_FOR_TOTALGAMINGADDRES_0001
I hope this helps.
I hope this can be done in EG. Assuming both your dates are datetimes, use INTCK to count the number of days between play and enrolment :
proc sql;
create table nextDays as
select t2.newEnrolmentDate, t1.*
from
PlayerDays as t1 inner join
Enrolments as t2 on
t1.guestNumber=t2.guestNumber and
intck("DTDAY", t2.newEnrolmentDate, t1.PlayerDayDate) between 0 and 3;
quit;
(untested)
PG
Thank you. You solved my problem.
I haven't tested it, but I believe it would be doable with the EG query builder.
Tom
Thank you!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.