Expand my Community achievements bar.

SOLVED

Filter the task with the MAX Go Live date for each project

Avatar

Level 7

I have four task bundles, and I want to filter out the task with the maximum date for each project. Any suggestions on how to achieve this?

Task bundles (each project has got multiple Go Lives)

TaskProjectGo Live Date
Task AProject 101-Jan-2023
Task BProject 101-Feb-2023
Task CProject 201-Mar-2023
Task DProject 201-Apr-2023


Expected Output:

TaskProjectGo Live Date
Task BProject 101-Feb-2023
Task DProject 201-Apr-2023


My approach: 
1) Apply dateDifference(Go Live Date;now)
2) The task with MAX date will have max date difference
3) Now I either need to numeric aggregate with project grouping to get MAX dateDifference record or somehow filter out unnecessary records. Need suggestion on how to proceed from here.

1 Accepted Solution

Avatar

Correct answer by
Level 7

I've figured out that I can achieve this by using an array aggregator, then sorting the resulting array based on date difference, and then using the `get()` function along with the `length()` function to obtain the last record in the sorted array.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 7

I've figured out that I can achieve this by using an array aggregator, then sorting the resulting array based on date difference, and then using the `get()` function along with the `length()` function to obtain the last record in the sorted array.