We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

First day of the year

Thombe
6 - Meteoroid

Hello everyone,

 

First of all, sorry for my english.

 

I have the column [DATE_ENGG] type DateTime like YYYY-MM-DD HH:MM:SS

 

I need to create a filter to keep only raws >= at the first day of the year.

 

I tried this 

 

ToDate([DATE_ENGG]) >= DateTimeFormat([DATE_ENGG],"%Y-01-01 00:00:00")

 

But it doesn't work :)

 

If someone can help me, i'm very grateful, thank you! 

7 REPLIES 7
alexnajm
18 - Pollux
18 - Pollux
ToDate([DATE_ENGG]) >= ToDate(DateTimeFormat([DATE_ENGG],"%Y-01-01"))

If it's already in DateTime, try removing the "00:00:00" part at the end and adding another ToDate!

Thombe
6 - Meteoroid

Hello Alexnajm,

 

Thank you for your fast reply, unfortunately all my raws are going on "true".

Some exemple of the column :

alterydatetime.PNG

 

Thank you

alexnajm
18 - Pollux
18 - Pollux

@Thombe can you send a screenshot of the metadata confirming it is set as a DateTime data type?

Thombe
6 - Meteoroid

datime.PNG

Cordially

binuacs
21 - Polaris

@Thombe Are you looking for the output that is greater than the first day of the current year or the first day of the DATE_ENGG field? 

alexnajm
18 - Pollux
18 - Pollux

Oh the formula is working correctly - currently it's saying that the DATE_ENG date should be greater than the first day of the year OF THAT YEAR. You likely want this:

ToDate([DATE_ENGG]) >= ToDate(DateTimeFormat(DateTimeToday(),"%Y-01-01"))

 

Thombe
6 - Meteoroid

Thank you everyone, i learn a lot of thing with your answers, have a good day :)

Labels
Top Solution Authors