Find the closest date
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have this sample dataset
I wanna check from the column rate date the nearest dates to the dates in April and October column, is there anyway to do that?
Thanks in advance.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AbdullahMansour90 are you trying to get whether the April or October date is closest to the rate date? I am not clear on the question. If that is what you are trying to do, you could use a formula tool with "if datetimediff(october date, rate date, "days") > datetimediff(april date, rate date, "days") then "October" else "April" endif... or something like that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @AbdullahMansour90 ,
If I understand the requirements correctly, you want to find the rate date which is closest to April/October Days for each year?
If yes, then the following workflow should work for you
Essentially you are estimating the difference of each rate day from the April and October columns and then finding the minimum values for each year through the summarize tool.
Finally, it is just a matter of putting everything back together and creating the flag for the minimum date.
Hope that helps, let me know if that worked for you.
Regards,
Angelos
