Based upon this input I have to find the count of holidays in the below Calendar
Like in this scenario, Once I will iterate through Array {“23/01”,“23/03”, " 23/04"}
for
23/01 - If we look at the PP calendar ( 1st screenshot) we will get the from date 12/24/22 i.e. 24th Dec 2022 and to date 01/08/23 i.e. 8th Jan 2023. now we have to search for this date in the holiday calendar. I should get count 2 (one holiday on 25th Dec 2022 and another holiday on 1st Jan 2023.
Similarly for 23/03 - I should get a count of 0 ( start date 23rd Jan 2023 to 05th Feb 2023)
Similarly for 23/04 - I should get count 1 ( There is only one holiday on 13th Feb 2023 ( start date 06 Feb 2023 to 19th Feb 2023)
Above query is working fine first time ( without loop) but second time it’s giving message " No value in Sequence" and result is Null.
If we run individually, every time it will work fine, even while doing testing I created a small flow and it’s running fine in loop also but while implementing in project ( which is having huge workflow, it’s giving error while trying to fetch value second time.
I also tried to create separate workflow for this, but that also doesn’t help and getting same error.
we can create the series of an interval e.g. For 23/04 by
And using an inner join / match / lookup / set operations approach to get the corresponding holidays
For sure we can concat multiple inputs like {“23/01”,“23/03”, " 23/04"}
to search the corresponding start date and generating the corresponding interval
(From d In dtData
Let dp = DateTime.ParseExact(d(1).toString.Trim,"MM.dd.yy",System.Globalization.CultureInfo.InvariantCulture)
Let dl = Enumerable.Range(0,15).Select(Function (x) dp.AddDays(x).toString("M/d/yyyy")).ToArray
Select t = Tuple.Create(d(0).toString.Trim, dl)).toDictionary(Function (t) t.Item1, Function (t) t.Item2)
We can create an array of all datesm defined by the input myFilter = {"23/01","23/03","23/04"}