• SwePeso (3/1/2015)


    Be very careful with LAG here. If you for some reason don't have data for the previous measure period, you will get the measure period before that.

    That's why why need the INTERVAL implementation for windowed functions.

    Given that the output includes both the start date and the end date for the interval reported, that strikes me as singularly irrelevant. Indeed there's nothing to tell us that all the measuring points (labels Tn) use the same length periods at all times, except that this just happens to be true in the tiny sample of data we are shown.

    Tom