Based on the below table I want to calculate the difference (in days) between the current date and the previous date this Category appears in the past.
Notes
- In case there is no previous appearance i do not to show anything.
- Table in not sorted.
Up to now
I manage to add index in each row ordered by date.
Any ideas how to proceed?