I have two dataframes DF1 and DF2.
DF1:
StartDate
1/1/2013
2/1/2013
11/1/2014
4/1/2014
5/1/2015
DF2:
EmploymentType EmpStatus EmpStartDate
Employee Active 11/5/2012
Employee Active 9/10/2012
Employee Active 10/15/2013
Employee Active 10/29/2013
Employee Terminated 10/29/2013
Contractor Terminated 11/20/2014
Contractor Active 11/20/2014
I want the count of rows from DF2 where EmploymentType = 'Employee' and EmpStatus = 'Active' and EmpStartDate<= Start Date of DF1
Output:
Start Date Count
1/1/2013 2
2/1/2013 2
11/1/2014 4
4/1/2014 4
5/1/2015 4
How do I achieve this without merging the two dataframes?
I cannot merge the dataframes since there are no common keys and since I need the count of rows based on conditions, I cannot join the dataframes on any temporary columns as I need to avoid cross-join.