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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.