Good afternoon Alteryx team,
I have built a flow that runs weekly. When it runs once a week I want the flow to run today's date and -7 days back so it picks up the week pryor. But when the flow runs it is only picking up the 7th day back. Example- today is 10/10, when the flow runs it only picks up 7/3. Here is what my formula says DATETIMEADD(DateTimeToday(), -7, "days")
Any help is appreciated. Thank you
Solved! Go to Solution.
Hi @Plewis1
Could you please show a sample of what you're trying to do?
A sample of your workflow, and explain better what you're trying to achieve.
Cheers,
Hi @Plewis1
Dates can be tricky at the best of times, so a good starting point is to first confirm that all your relevant Date columns are in the DateTime format. This will eliminate any downstream errors when comparing one date against another.
Regarding your formula, your logic is spot on in regards to removing the 7 days, but the key will be to compare this formula against the date field formatted as a DateTime column within the dataset - for example "Date". By using the below formula in a Filter Tool, you should be able to obtain records only within the last 7 days.
[Date] >= DATETIMEADD(DateTimeToday(), -7, "days")
//Where [Date] is a substitute for the Date column within the dataset
Hope this helps!
Here is the formula that is built. As you can see the date is showing 10/3 when it should be the whole week. 10/3 to 10/10. I highlighted it in yellow.
Hee is my spreadsheet from the output tool. All the dates in my date column are all 10/3.
Hi @Plewis1
Workflow is attached.
Thanks for providing these examples. One potential issue could be that your formula is overwriting every cell in the column "INSPECTION_CREAT..." with the date from 7 days ago.
But I can see that your date column is indeed formatted as a date column, so by using the Filter Tool we can get records for the week prior anchored to anchored to today's date.
Assuming that the column "INSPECTION_CREAT..." is "INSPECTION_CREATED_DATE" and has not been overwritten by the formula tool in example, then the below workflow returns only records that are within the past 7 days.
Hope this helps!
Thank you for that flow. Flow still shows to have one issue. I am only seeing data out of the FALSE connection and not the TRUE. The data coming out of the FALSE connection has all the days going back to 2018. And there is no data coming out of the TRUE connector. I will put an example below.
FALSE CONNECTOR
TRUE CONNECTOR
Nvm, There isn't any dates in my sheet from today and -7. Thank you for your help.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |