-2

I have a dataset with a START_DATE column and a string column like this:

START_DATE             string
2017-03-31                a
2017-04-30                b
2017-05-30                c

I want to transform it into this format like this:

START_DATE             string
2017-03-31                a
2017-04-30                b
2017-05-30                c 
2017-06-30
2017-07-31
2017-08-31
2017-09-30
2017-10-31
2017-11-30
2017-12-31
2017-01-31
2017-02-28
2017-03-31

Is there any easy solution to this question?

Thanks!

potatout
  • 187
  • 1
  • 11

1 Answers1

0

I don't know for how long this should go on, but you could use a for loop that spans over a certain time window, adding one month to the current date at every iteration and get the last day of the month.

In order to get the last day of the month, see Get last day of the month

lsabi
  • 3,641
  • 1
  • 14
  • 26