Solution Review: Compute Fortnightly Changes
Explore how to compute fortnightly changes by applying SQL window functions and common table expressions. Understand using the lag function and ISO day extraction to compare values across data partitions for accurate time-based analysis.
We'll cover the following...
We'll cover the following...
Solution
The solution for the challenge is given below. Click the “Run” button in the following widget to see the output of the code.
Explanation
To compute weekly changes, we use window functions. To view the two weeks before the first of the month, we extend our calendar selection two weeks into the past and then restrict the data.
Here is the ...