Hi, I'm working with a dataset looks something like below: account month_end open_indicator 1 30-Nov-19 yes 1 31-Dec-19 no 1 31-Jan-20 no 1 29-Feb-20 no 1 31-Mar-20 no 2 30-Nov-19 yes 2 31-Dec-19 yes 2 31-Jan-20 no 2 29-Feb-20 no 2 31-Mar-20 no 3 30-Nov-19 yes 3 31-Dec-19 yes 3 31-Jan-20 yes 3 29-Feb-20 no 3 31-Mar-20 no Field description Account: unique account number Month_end: date Open_indicator: indicates whether an account is open or close at the end of the month I'd like to get help with creating an additional column that gives a flag, let's say 1, ONLY on the first time that an account close, otherwise 0. Below is example of the output i'd like to achieve, where "close" field contains value 1 when an account closes for the first time. account month_end open_indicator close 1 30-Nov-19 yes 0 1 31-Dec-19 no 1 1 31-Jan-20 no 0 1 29-Feb-20 no 0 1 31-Mar-20 no 0 2 30-Nov-19 yes 0 2 31-Dec-19 yes 0 2 31-Jan-20 no 1 2 29-Feb-20 no 0 2 31-Mar-20 no 0 3 30-Nov-19 yes 0 3 31-Dec-19 yes 0 3 31-Jan-20 yes 0 3 29-Feb-20 no 1 3 31-Mar-20 no 0 Thank you for your help!
... View more