Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Dynamic add to Date time add function

blakea
5 - Atom

Hello, 

 

Very new to the tool. I'm trying to start by building off of a spreadsheet I already have. The primary roadblock I have run into is working with dates. I am trying to calculate a runout date which I can do pretty simply in excel, but between formatting and an apparent inability to add outputs together with the DateTimeAdd function, I have hit a brick wall.

 

So I am trying to add number of days of stock I have available to the current date to give me a projection of when I will run out of stock. Seems like a pretty straight forward calculation, but every solution I have found seems to only use a static calculation. Any suggestions? Below is the suggestion of what I have started to work with, but I need -7 to refer back to a calculated field where each row would be different and "days" needs to output as a date.

 

DATETIMEADD(DateTimeToday(), -7, "days")

 

3 REPLIES 3
Christina_H
14 - Magnetar

You can just replace the -7 with the field you want to use instead, e.g. DATETIMEADD(DateTimeToday(), [Days], "days") where Days is a numeric field.

Christina_Hurrell_0-1632145912581.png

 

blakea
5 - Atom

So strange, I tried that before and it didn't work, but seems to work now. Thanks!

khuebsch5
6 - Meteoroid

Hi -- what kind of data type needs to be selected for the numeric field? I've got a static field created to use, but whenever I replace -1 with the value in the field, it just nulls out.

Labels