Filter the task with the MAX Go Live date for each project | Community
Skip to main content
_Manish_Singh
New Participant
September 5, 2023
Solved

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

  • September 5, 2023
  • 1 reply
  • 529 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by _Manish_Singh

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.

1 reply

_Manish_Singh
_Manish_SinghAuthorAccepted solution
New Participant
September 5, 2023

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.