I have a column with customer IDs and a bunch of columns (1 to 12) with date flags. I want to stack the non-zero date flags as dates in one column and repeat/replace the IDs corresponding to them in the ID column.
Input Data:
ID 1 2 3 4 5 6 7 8 9 10 11 12
A Jan-18 0 0 0 May-18 0 0 0 Sep-18 0 0 0
B 0 0 0 Apr-18 0 0 Aug-18 0 0 0 0 0
Expected Output:
ID Date
A Jan-18
A May-18
A Sep-18
B Apr-18
B Aug-18