
Hi Community,
Bit of a headscratcher here, feel like this should be simple but running into roadblocks. I am trying to create a collection using some variable data. In short I want to create a collection where multiple headers are created using a Forall Function. Here is what I have created:
First I have these two collections which the Forall's look at
ClearCollect(Collection_TechnicianList,
{TechnicianName:"JK", TechnicianEmail:"J*****.K*****@*****.co.uk", TechnicianFullName:"J***** K*****"},
{TechnicianName:"MD", TechnicianEmail:"M*****.D*****@*****.co.uk", TechnicianFullName:"M***** D*****"},
{TechnicianName:"RW", TechnicianEmail:"R*****.W*****@*****.co.uk", TechnicianFullName:"R***** W*****"},
{TechnicianName:"ST", TechnicianEmail:"S*****.T*****@*****.co.uk", TechnicianFullName:"S***** T*****"})//Lists all the status' for reports
ClearCollect(Collection_Status,
{StatusSelection:"New"},
{StatusSelection:"In Progress"},
{StatusSelection:"Awaiting Reposne"},
{StatusSelection:"Awaiting Technical Information"},
{StatusSelection:"Awaiting Client Approval"})
From these I am then trying to create the collection, but I run into errors, here are the two variations I have attempted.
Clear(Collection_Report_Technician_ClosedType);
ForAll(Collection_TechnicianList,
Collect(Collection_Report_Technician_ClosedType,
{
Technician:TechnicianFullName,
ForAll(Collection_Status,
StatusSelection:
CountIf('Enginering Ticket System',
'Ticket Type'.Value=StatusSelection,
DateValue('Closed Date') >= DatePicker_ReportStart.SelectedDate,
DateValue('Closed Date') <= DatePicker_ReportEnd.SelectedDate,
Status.Value="Completed",
'Assigned to'.Email=TechnicianEmail
)
)
}
)
);Clear(Collection_Report_Technician_ClosedType);
ForAll(Collection_TechnicianList,
Collect(Collection_Report_Technician_ClosedType,
{
Technician:TechnicianFullName}));
ForAll(Collection_Status,AddColumns(Collection_TechnicianList,StatusSelection,ForAll(Collection_TechnicianList,LookUp(Collection_Report_Technician_ClosedType,Technician=TechnicianFullName,CountIf('Enginering Ticket System',
'Ticket Type'.Value=StatusSelection,
DateValue('Closed Date') >= DatePicker_ReportStart.SelectedDate,
DateValue('Closed Date') <= DatePicker_ReportEnd.SelectedDate,
Status.Value="Completed",
'Assigned to'.Email=TechnicianEmail)))))
Any ideas on how I can get this to work?
Whilst writing this I have noticed that there is a slight problem of I need to add a comma at the end of each all which I probably should do with a Concatenate and some magic to remove it from the last one.
Hi,
What result are you trying to get?
Can yo show sample data from Engineering Ticket System?