Have a look at this. Not sure if you want to use the 'Days of Leave' column in the while loop or change it to not go past the 'End Date' value.
Code:
node:Static_Data
bretype:core::Static Data
editor:sortkey=5c19895267015d92
output:@40fe6c55598828e5/=
prop:StaticData=<<EOX
ID Number:int,Staff Name,Leave Type,Start Date,End Date,Days of Leave:int
12345678,Arnold Stallone,Annual Leave,17-Dec-18,21-Dec-18,5
EOX
editor:XY=160,150
end:Static_Data
node:Filter
bretype:core::Filter
editor:sortkey=5c19896b777472da
input:@40fd2c74167f1ca2/=Static_Data.40fe6c55598828e5
output:@40fd2c7420761db6/=
prop:Script=<<EOX
_startDate = 'Start Date'.date("DD-m-YY")
_endDate = 'End Date'.date("DD-m-YY")
# configure metadata for output pin
output 1 {
emit int(null) as "ID Number", str(null) as "Staff Name", str(null) as "Leave Type",
date(null) as "Start Date", date(null) as "End Date", int(null) as "Days of Leave"
where false
}
i = 0 # set a counter for while loop
while i < 'Days of Leave' {
_newDate = _startDate.dateAdjust(i,"days") # increament days
# output pin
do output 1 {
emit 'ID Number', 'Staff Name', 'Leave Type',
_newDate as "Start Date", _newDate as "End Date",
1 as "Days of Leave"
}
i = i + 1
}
EOX
editor:XY=270,150
end:Filter