@mdevaney
This is where all the magic happens
Concat(Gallery2.AllItems, "<tr> <th rowspan='2'>" & EmployeeName & "</th>" & Concat(ZileLuna, "<td colspan='2'>" & If(Value in WeekDaysCollection, " ",If(IsBlank(LookUp (HolidaysCollection, Text(Value, "[$-en-US]mm/dd") = Text (StartDate, "[$-en-US]mm/dd") )), "8", "Liber" ) ) & "</td>" ) & "</tr> <tr>" & Concat(ZileLuna, "<td>" & If(Value in WeekDaysCollection, " ", If(IsBlank(LookUp(HolidaysCollection, Text(Value, "[$-en-US]mm/dd") = Text (StartDate, "[$-en-US]mm/dd") )), "10" )) &"</td>" &"<td>" & If(Value in WeekDaysCollection, " ", If(IsBlank(LookUp(HolidaysCollection, Text(Value, "[$-en-US]mm/dd") = Text (StartDate, "[$-en-US]mm/dd") )), "18" )) & "</td>" ) & "</tr>"
Gallery2.AllItems retrieves all the employees from an excel collection.
ZileLuna is a collection with every day in the current month.
WeekDaysCollection is a collection with all the weekends dates in the current month.
HolidaysCollection is a collection with all the holidays dates.
To build the collection with all the dates when someone is on leave im doing it like this
ClearCollect(ZileConcediiInLuna,AddColumns(RenameColumns(ZileLuna,"Value","SearchDate"),"LEAVE",If(!IsBlank(LookUp(Table4,Text(SearchDate,"[$-en-US]mm/dd/yyyy") = Text(Date,"[$-en-US]mm/dd/yyyy"))),"O.H")))
To build the weekends and the holidays i do it with If(Value in Collection, "message") but because the collection with approved leave requests stores all the dates, if i do that, will fill every day with O.H.