Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date Formula issues

svargas01
6 - Meteoroid

Hi all, I have an excel file I am trying to filter the data to show only the rows that have a start date from 10 days back through today. Currently this is my formula:

 

[Start Date] >= ToDate(DateTimeAdd(DateTimeToday(), -1 * 10, "days")

 

The issue I am seeing is that its not actually showing today's date. Can anyone help me to understand what I did wrong and how I can fix it going forward?

I am pretty inexperienced in Alteryx, and learning as I go - so all the help I can get is appreciated!

4 REPLIES 4
aatalai
15 - Aurora

@svargas01  try this expression

 

[Start Date] >= DateTimeAdd(DateTimeFormat(DateTimeNow(),"%Y-%m-%d"),-10,"days")

 

also attached a workflow for refence. Let me know if it helps

binuacs
21 - Polaris

@svargas01 

try

toDate([Start Date]) >= ToDate(DateTimeAdd(DateTimeToday(), -1 * 10, "days")

svargas01
6 - Meteoroid

Okay - so I have some follow up questions.

 

My current workflow sets the date time differently. I have it output from the DateTime as:

2000-01-02 03:04:05

 

- Does this format matter for your formula? 

 

In my Start Date filter I originally had 2 formulas, the date one I mentioned (date >= 10 days back) as well as one to filter on a second column to show only rows where that column has 9 digits. Here is the full original formula:

 

[Start Date] >= ToDate(DateTimeAdd(DateTimeToday(), -1 * 10, "days"))

AND

[Start Date] <= DateTimeToday() and length(tostring([BANK_ACCOUNT_NUM]))==9

 

When I replace the first part with your formula, I get a parse error - do I need to change the second portion of my formula as well? or is it related to the the output format I have in the DateTime tool?

 

 

Unfortunately I am not able to share my data, but I could provide screenshots of my workflow if that would help.

 

Thanks for your time and help!

binuacs
21 - Polaris

@svargas01 what is the data type of start date? Yes provide a screenshot of formula tool

Labels
Top Solution Authors