Date Calc
- 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 am trying to build a formula to calculate the end date if I have a start date and the term (based on the # of months). For example: if I have a start date of 11/1/2020 and the term is over 180 months what is my end date?
Thanks
Irene
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @IreneTrieu,
The function you're going to want to use in a formula tool is DateTimeAdd. The first argument is the start date, then the number of 'unit' you want to go forward, and then the date part. In this case, 180 and 'month'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try the DateTimeAdd function, in a Formula tool
Here's a list of all functions: https://help.alteryx.com/current/designer/functions
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you! Sorry, I have various end dates. Is there a formula to take the start date x term = end date
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you provide a sample input file?
You will need your data to be in a data stream that includes fields like this:
Start Date | Number of months |
9/21/2022 | 180 |
10/21/2022 | 6 |
You may need to use other tools in your data stream, before you use the DataTimeAdd function.
What does your data look like, at the point where you need to ad the Term?
Providing your data in a workflow, or pasting your data as text (not an image), would be helpful.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@IreneTrieu please see attached one way of getting to your desired output. You would first need to convert your dates to Alteryx date format (YYYY-MM-DD) with the DateTime tool and then drop in a Formula tool that will allow you to create a formula to add the terms to your dates and get to your end date.
If this help answer your question, please mark as solution so others can follow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!
