Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help needed in replicating rows in the script

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,

1 Reply
m_woolf
Master II
Master II