my dataset
name date record
A 2018-09-18 95
A 2018-10-11 104
A 2018-10-30 230
A 2018-11-23 124
B 2020-01-24 95
B 2020-02-11 167
B 2020-03-07 78
As you can see, there are several records by name and date.
Compared to the previous record, I would like to see the record that rose the most.
output what I want
name record_before_date record_before record_increase_date record_increase increase_rate
A 2018-10-11 104 2018-10-30 230 121.25
B 2020-01-24 95 2020-02-11 167 75.79
I`m not comparing the lowest to the highest, but I want to check the record with the highest ascent rate when the next record comes, and the rate of ascent.
increase rate formula = (record_increase - record_before) / record_before * 100
Any help would be appreciated. thanks for reading.