Skip to content
Advertisement

Select Rows Based on Time Difference [Before or After] In Columns

I have the following dataset of students taking 2 different exams:

JavaScript

I want to select those students whose two exams are 10 days apart from each other in either direction.

I am trying Timedelta, but I’m not sure if it’s optimal.

JavaScript

Desired Output:

JavaScript

Is there any better way of getting the desired output? Any suggestions would be appreciated. Thanks!

Advertisement

Answer

Try as follows:

JavaScript

Or maybe nicer:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement