Hello!!
I have a problem:
-I have 2 tables (One table is a list of IDs -users- that I have active within my platform per day and the second table is of the purchases have made those users per day).
-First table: UID (User) , day (the day refers to that day my user is still active within the platform) <--- I have this opening by day for the whole year.
-Second table: UID, Purchases, day of purchase <--- I have this opening by day for the whole year.
What I want is to find the following output and the following will be an example to make clearer what I am looking for.
Suppose I am an active user on February 10, 2022 and what I am looking for is to find the date of the last purchase I made between January 1 and February 10. THE CONDITION IS THAT I DON'T SEARCH FOR DATES AFTER FEBRUARY 10, WHICH WOULD BE MY MAXIMUM SEARCH CONIDITION.
In the same dataset I have that my user is still active on May 15 so what I am looking for is the same as in the previous paragraph... to match with the second table to find my last purchase date I made taking the range of time now between January 1 and May 15. THE CONDITION IS THAT I DON'T SEARCH FOR DATES AFTER MAY 15TH WHICH WOULD BE MY MAXIMUM SEARCH CONIDTION.
In the user dataset I will be "repeating myself on a daily basis" and what I am looking for is to find for each of those days the last purchase date taking as maximum search condition the date of the active user.
I hope my problematic is clear.
Thank you!