I need help calculating the difference in two dates if certain criterias are met.
When One
is 1
calculate the difference between the date of that value with the date when Move
is 1
for each unique values of Person
. When the difference in days are calculated, check for the next 1
in One
, and so on. When One
and Move
have 1
in the same row, the value should be 0 (as seen in 14.01.2018). Notice the value in 05.01.2018, value 3
takes the date from 03.01.2018 (not 02.01.2018), as it is the last one if there are leading 1
's.
The expected values are in Days
in bold and red:
I have been trying to do this for days in Python programming software, but without success. Any help is appreciated.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.