Code: Select all
COMPUTE episode=1. IF (id=LAG(id) AND service=LAG(service)) episode=1. * Now every case which is part of an episode is set to 1, except from the first case of each episode. * So we have to reorder and repeat the IF command. SORT CASES id (A) service (A) servicedate (D). IF (id=LAG(id) AND service=LAG(service)) episode=1. EXECUTE.
Users browsing this forum: No registered users and 2 guests