Hi @vcocco,
If you think of getting the days between those dates, then you need to just switch the places of the dates.
Math.floor((Date.now().minusDays(1)) - Date.parse("2021-08-01") / (1000*60*60*24))
But if you want to get range of dates then, use this expression.
sl.range(0, Math.floor((Date.now().minusDays(1)) - Date.parse("2021-08-01") / (1000*60*60*24))).map(x => Date.parse("2021-08-01").plusDays(x))
This will return you array with range of dates, so after the mapper you can use JSON Splitter snap to split the dates in more documents.
Regards,
Viktor Nedanovski