Looking for a way to find values of a row only when it's changed from the previous row. What I have are the follow:
and what I want to do is look for only values where the location has changed and end up with the following:
I know I'm missing something easy but everything I try seems to come back wrong.
You need the LAG function which is not implemented in Teradata, but easy to rewrite:
OVER (PARTITION BY Account -- ? probably
ORDER BY time_stamp
ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) as previous_location