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!
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 25. Read more here about why you should contribute and what is in it for you!
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.