This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I wanted to know if there is a certain type of formula that can autofill dates to remove manual manipulation each time I run a workflow. Currently for each new report I run there is a date range that I am manually adjusting in bold
IF [DAY]="Monday" THEN "07/11/2016" ELSEIF [DAY]="Tuesday" THEN "07/12/2016" ELSEIF [DAY]="Wednesday" THEN "07/13/2016" ELSEIF [DAY]="Thursday" THEN "07/14/2016" ELSEIF [DAY]="Friday" THEN "07/15/2016" ELSEIF [DAY]="Saturday" THEN "07/16/2016" ELSEIF [DAY]="Sunday" THEN "07/10/2016" ELSE "" ENDIF
If I enter one date for my event start date of 07/12/2016 is there a way to make Alteryx know to change monday to 7/11 and so on? Another caveat to this reports is the dates are always at a future point in time so it's not the current date, I am always going to be about a month ahead of when I work on it..if that makes sense.
I see a record coming in as Friday, so you want me to make that June 16th plus 1 day = June 17th. The next record is Monday, so you want me to make that June 16th plus 4 days = June 20th.
If the day value for today is less than the day value for the day in question, then you want to add the difference (e.g. 3 for Thursday and 4 for Friday). DateTimeAdd(datetimenow(),4-3, 'days')
If the day value for today is greater than or equal to the day value for the day in question, then you want to add 7 minus the difference (e.g. 3 for Thursday and 0 for Monday). DateTimeAdd(datetimenow(),7-3-0,'days')
Is this the right path?
Alteryx ACE & Top Community Contributor
Chaos reigns within. Repent, reflect and reboot. Order shall return.
I had to do something similar, and what helped me was setting one of the dates as the START_DATE and then using date formulas and calculations to set the remaining dates. Then, you just have to set that start date in one place and the remaining dates will adjust accordingly.
Set START_DATE = '7/12/2016' automatically in a workflow step or manually with a formula tool
You can also set global environment variables for your entire workflow, so if you needed to set some start point that could later be referenced via formula or other kinds of tools, thats another option to consider.