Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Date Calc

IreneTrieu
7 - Meteor

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

6 REPLIES 6
JamesCharnley
13 - Pulsar

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'.

 

JamesCharnley_0-1666368425918.png

 

ChrisTX
15 - Aurora

Try the DateTimeAdd function, in a Formula tool

 

Here's a list of all functions:  https://help.alteryx.com/current/designer/functions

 

Chris

 

IreneTrieu
7 - Meteor

Thank you!  Sorry, I have various end dates.  Is there a formula to take the start date x term = end date

ChrisTX
15 - Aurora

Can you provide a sample input file?

 

You will need your data to be in a data stream that includes fields like this:

 

Start DateNumber of months
9/21/2022180
10/21/20226

 

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

gyang3
Alteryx
Alteryx

@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. 

gyang3_0-1666387892040.png

 

If this help answer your question, please mark as solution so others can follow.

IreneTrieu
7 - Meteor

Thank you!

 

Labels