Selecting Latest Date from Multiple Values
Selecting Latest Date from Multiple Values
Hello there, so I want to get an output that displays the latest date from the values in my JSON object, but i'm having a hard time getting it to work.
I'm not sure of the expression I would have to write to get this to work.
For example, my JSON looks like:
"Reg1Approval": "N/A",
"Reg2Approval": "05/16/2024",
"Reg3Approval": "07/25/2024",
"Reg4Approval": "12/03/2024",
"Reg5Approval": "01/08/2025",
I want to look at all "Reg1-5Approvals" and have the latest date displayed (which would be the value "01/08/2025"
I'm not sure of the expression I would have to write to get this to work.
For example, my JSON looks like:
"Reg1Approval": "N/A",
"Reg2Approval": "05/16/2024",
"Reg3Approval": "07/25/2024",
"Reg4Approval": "12/03/2024",
"Reg5Approval": "01/08/2025",
I want to look at all "Reg1-5Approvals" and have the latest date displayed (which would be the value "01/08/2025"
-
- Posts: 7354
- Joined: Tue Mar 20, 2018 5:34 am
Re: Selecting Latest Date from Multiple Values
Hello,
You can use the Last() function from the Dictionary.
Thank you.
You can use the Last() function from the Dictionary.
Thank you.
Re: Selecting Latest Date from Multiple Values
Let's say that was not always the case, for example:
"Reg1Approval": "N/A",
"Reg2Approval": "05/16/2024",
"Reg3Approval": "07/25/2027",
"Reg4Approval": "12/03/2023",
"Reg5Approval": "01/08/2024",
How can I get the latest from this? I tried using the Latest() function, but can't seem to get it to work
"Reg1Approval": "N/A",
"Reg2Approval": "05/16/2024",
"Reg3Approval": "07/25/2027",
"Reg4Approval": "12/03/2023",
"Reg5Approval": "01/08/2024",
How can I get the latest from this? I tried using the Latest() function, but can't seem to get it to work
-
- Posts: 7354
- Joined: Tue Mar 20, 2018 5:34 am
Re: Selecting Latest Date from Multiple Values
Hello,
Sorry, we did not exactly understand your question. Could you explain your issue in more detail?
Thank you.
Sorry, we did not exactly understand your question. Could you explain your issue in more detail?
Thank you.
Re: Selecting Latest Date from Multiple Values
I have a field called "Latest Approval Date". I want to essentially look at my 5 values provided and have it pull in the latest date. The "RegApproval" isn't always going to be in order from 1 -> 5, it's just whenever they get a chance to review and approve the project, they can do that. We just need all 5 Approval Dates.
So in my example
"Reg1Approval": "N/A",
"Reg2Approval": "05/16/2024",
"Reg3Approval": "07/25/2027",
"Reg4Approval": "12/03/2023",
"Reg5Approval": "01/08/2024"
We can see that the latest date is actually 07/25/2027. So we need to be able to get that value (which is Reg3Approval). Another project might have the latest Approval Date being Reg 1 or 2.
So in my example
"Reg1Approval": "N/A",
"Reg2Approval": "05/16/2024",
"Reg3Approval": "07/25/2027",
"Reg4Approval": "12/03/2023",
"Reg5Approval": "01/08/2024"
We can see that the latest date is actually 07/25/2027. So we need to be able to get that value (which is Reg3Approval). Another project might have the latest Approval Date being Reg 1 or 2.
-
- Posts: 7354
- Joined: Tue Mar 20, 2018 5:34 am
Re: Selecting Latest Date from Multiple Values
Hello,
In this case, you can use the {MaxDate()} function from the Dictionary.
Thank you.
In this case, you can use the {MaxDate()} function from the Dictionary.
Thank you.
Re: Selecting Latest Date from Multiple Values
It feels like {MaxDate()} only let's me choose 1 key though.
How can I select Reg1-5 with this function?
How can I select Reg1-5 with this function?
-
- Posts: 7354
- Joined: Tue Mar 20, 2018 5:34 am
Re: Selecting Latest Date from Multiple Values
Hello,
You can use the following expression:
{MaxDate(DataSource, DataSource.Column)}
Thank you.
You can use the following expression:
{MaxDate(DataSource, DataSource.Column)}
Thank you.
- Attachments
-
- Screenshot 2025-07-22 111400.png (61.55 KiB) Viewed 4342 times
Re: Selecting Latest Date from Multiple Values
I think we're still misaligned. Let's say I have 5 Projects, each project has Reg 1-5. For each Project, I only want to display the latest Reg date
-
- Posts: 7354
- Joined: Tue Mar 20, 2018 5:34 am
Re: Selecting Latest Date from Multiple Values
Hello,
Please send us test data for analysis.
Thank you.
Please send us test data for analysis.
Thank you.