hey @llserra
can you please try this:
ClearCollect(Collect2,
AddColumns(
GroupBy(Collect1, "User", "Program", "GroupedData"),
"TotalHours", Sum(GroupedData, Hours)
)
);
In this formula:
GroupBy(Collect1, "User", "Program", "GroupedData") groups your original collection by User and Program. The result is a collection of unique User/Program combinations, each with a sub-collection (GroupedData) of the original items that fall into that group.
AddColumns(..., "TotalHours", Sum(GroupedData, Hours)) adds a new column to each group record that contains the sum of Hours from the GroupedData of that record.
This approach will give you a new collection (Collect2) where each record is a unique combination of User and Program, with an additional field (TotalHours) representing the total hours spent by that user on that program.
Please replace the Hours in the Sum(GroupedData, Hours) part of the formula with the correct name of your hours field if it's different. This solution assumes that Hours is the correct field name in your Collect1 collection.
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings