03-21-2022 08:02 AM
I have a special quarter division requirement where I have to allot data to different quarters based on the dates they belong, for this I need to get the first Monday of each month, tried the below logic to get it but not working for the Monday part.
Date.parse(‘2022-02-03’).getDay() == 1 ? Date.parse(‘2022-02-03’) : Date.parse(‘2022-02-03’).withDayOfWeek(1)
03-21-2022 08:25 AM
Do you have a predefined set of dates, or you want to generate all quarters within SnapLogic and then get the first Monday of each month ?
03-21-2022 08:49 AM
Sorry, I guess I read it a bit incorrect, it’s more complicated than I thought it would be,
Details:
03-23-2022 10:38 AM
Hey @vaidyarm,
There’s a very interesting function sl.range()
that will come in handy in cases when working with dates. The pipeline below will produce the quartals for this year while meeting the conditions you stated in your previous posts.
Check this and tell me what you think
This year quartals_2022_03_23.slp (8.4 KB)