Hello,
Don't know if you solved it yet, but here is what I use to publish an article within the next 30 days at random:
DATEADD(CREATED_TIME(),IF(VALUE(RECORD_ID()) <= 0, 1, IF(VALUE(RECORD_ID()) >= 1000000, 30, MOD(VALUE(RECORD_ID()), 30) + 1)),"day")
You should easily be able to adapt that, to duplicate within the same month. Don't try to identify duplicates, just make it impossible to have duplicates by using algebra to generate the date!
Something like this if your first record has a date column:
IF(
DATETIME_FORMAT({Date}, 'D') > 15,
DATETIME_FORMAT({Date}, 'YYYY-M') & "-" & IF(
VALUE(RECORD_ID()) <= 0,
1,
IF(
VALUE(RECORD_ID()) >= 1000000,
30 - DATETIME_FORMAT({Date}, 'D'),
MOD(VALUE(RECORD_ID()), 30 - DATETIME_FORMAT({Date}, 'D')) + 1
)
),
DATETIME_FORMAT({Date}, 'YYYY-M') & "-" & IF(
VALUE(RECORD_ID()) <= 0,
1,
IF(
VALUE(RECORD_ID()) >= 1000000,
30 - DATETIME_FORMAT({Date}, 'D'),
MOD(VALUE(RECORD_ID()), 30 - DATETIME_FORMAT({Date}, 'D')) + 1
)
)
)
Cheers 👋