Calculating delta values in SQL
SELECT day, revenue, revenue - LAG(revenue, 1) OVER (ORDER BY day) AS daily_del FROM day;
The LAG() function does the job!!
Calculating the delta value is one of the most important job of a data scientist.
SQL queries
SELECT day, revenue, revenue - LAG(revenue, 1) OVER (ORDER BY day) AS daily_del FROM day;
The LAG() function does the job!!
Calculating the delta value is one of the most important job of a data scientist.
Log in or sign up for Devpost to join the conversation.