1 Reply Latest reply: Jul 28, 2017 12:04 PM by m w RSS

    Help needed in replicating rows in the script

    Arun Suryanaryanan

      Hello,

       

      I need to replicate a few rows where the replicated row would have a changed value in just one dimension. I have attached a table containing some sample data:

       

      NameNumberCountryStart YearEnd YearAY
      ABCA123France200320062004
      ABCA456France200320062004
      ABC France20032006

       

      In my data, the dimension AY would have a value only if the column 'Number' has a value. What I need to do is, in cases where the accident year is blank, I need to replicate the corresponding row as many times as the effective duration which is the period between the end year and the start year. The output needs to resemble the following format:

       

      NameNumberCountryStart YearEnd YearAY
      ABCA123France200320062004
      ABCA456France200320062004
      ABC France20032006
      ABC France200320062003
      ABC France200320062004
      ABC France200320062005
      ABC France20032006

      2006

       

       

      I was wondering how I could do this in the script using loops, because I have around 30000 cases in my data where I need to do the same.

       

      Thanks and Regards,