Final-round questions combine several steps and hide one edge case each. You have df (Juniper Lane orders), emp (employees), members and orders (the club, repeats already removed), daily (store days) and events (the web log).
Talk through the edge case before you write code: what happens at a group boundary, with ties, with members who ordered once, and with days that are missing from the data.