Tag: how to calculate difference between consecutive rows