Difference between two rows in Spark dataframe
You can use Window function if the calculation is fixed as calculating difference between previous months, or calculating between previous two months … etc. For that you can use lag and lead function with Window. But for that you need to change the date column as below so that it can be ordered. +——-+——+————–+——+ |Column1|Date … Read more