ID STATUS LAG STATUS Desired 1 active - 1 active active 1 inactive active active 2 active - 2 inactive active active 3 inactive - 3 active inactive 3 inactive active 3 inactive inactive active 4 inactive - 4 active inactive 4 urgent active 4 inactive urgent 4 inactive inactive urgent I am starting out with the ID and Status fields. I created a new variable called lag status to capture the previous value for each ID. I am trying to figure out which function I could use to capture the previous value of the status field when it isn't equal to the current value of the field. There can be other value types other than inactive. The desired column shows which values I want returned. So for ID3, I want active returned since it was the previous value before inactive. For ID4, I want urgent returned since it's the previous value before the inactive.
... View more