Hi Folks,
I'm trying to create a collection which has all Mondays date in the current financial year. (April 1 2023, to March 31 2024). I found the below code which returns all Mondays in a calendar year:
ClearCollect(weeksList, ForAll(Sequence(52,-26,1) As DD, Text(DateAdd(DateAdd(Today(),-Weekday(Today(),Monday)+1),7 * DD.Value ,Days),DateTimeFormat.ShortDate) ) );
Can some one help me to modify this code such that it will return all Mondays between two dates?
Thanks
Hi @rbn_nue ,
Please try:
Filter(
With(
{
StartDate:DateValue("April 1 2023"),
EndDate:DateValue("March 31 2024")
},
ForAll(
Sequence(DateDiff(StartDate,EndDate),1,1),
If(
Weekday(DateAdd(StartDate,Value,TimeUnit.Days))=2,
{Value:DateAdd(StartDate,Value,TimeUnit.Days)}
)
)
),!IsBlank(Value))
Best Regards,
Bof
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.