Concept Flow - NTH_VALUE function
Start with ordered data
Define window partition and order
Locate Nth row in window
Return value from Nth row
If Nth row missing, return NULL
End
The NTH_VALUE function picks the value from the Nth row in a defined window of ordered data. If that row doesn't exist, it returns NULL.