7 Replies Latest reply: Mar 16, 2017 10:53 AM by Maria Harmening RSS

    Load data using a loop

    Maria Harmening

      I'm not sure if I'm asking this correctly, but this is essentially what I want to do in a nutshell.

       

      I have data that I'm loading that has a begin date and an end date.  so, I want to duplicate the data so that I can chart it by month and by year.  for example...

       

      jane doe starts employment march 1, 2017 and ends employment August 31 2017.  I want to chart everyone that it's employed for the next 12 months.  so, for feb, she would be a no.  for march she would be a yes, for april she would be a yes, and so forth..

       

      the data currently looks like this.

       

      Name                   Start Date                 End Date

      Jane Doe             3/1/2017                    8/31/2017

      John Doe              1/1/2017                   1/1/2020

       

      and I want it to look like this ...

       

      Name                   Start Date                 End Date             MonthStatus                Month                               

      Jane Doe             3/1/2017                    8/31/2017             0                                  Feb                   

      Jane Doe             3/1/2017                    8/31/2017             1                                  March        

      Jane Doe             3/1/2017                    8/31/2017             1                                  April

      ...                       

      John Doe            1/1/2017                   1/1/2020                 1                                  Feb

      John Doe            1/1/2017                   1/1/2020                 1                                  March

       

      I will be updating the data monthly, so in the load, I would have a variable for current month and I would want to load current month + 11...

       

      I also want to do the same routine for Fiscal year, but I'm sure it'll be the same code...except instead of MonthStatus, it would be YearStatus and Month would be FY.