Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Date filter

munchkin100
7 - Meteor

Hi, I looked through the posts on forum, but none of the solutions work for me. I was wondering, if is there any smart way of filtering the data to the current year only, based on the date field (yyyy-MM-dd). I have tried to use 

 

[Date]=DateTimeAdd(DateTimeToday(),-0,"years")

 

but it didnt work.

 

Most of the answers refer to a string format. Do I need to convert it to the string first? I would appreciate any help

3 REPLIES 3
munchkin100
7 - Meteor

Just solved it. I used this formula and it works perfect

 

[Date] >=
(DATETIMEFORMAT(DateTimeNow(), "%Y"))+"-01-01"
AND
[Date] <=
(DATETIMEFORMAT(DateTimeNow(), "%Y"))+"-12-31"

atcodedog05
22 - Nova
22 - Nova

Hi @munchkin100 

 

You can do

 

DATETIMEFORMAT([Date], "%Y")=DATETIMEFORMAT(DateTimeNow(), "%Y")

 

To check only for the current year.

 

Hope this helps : )

messi007
15 - Aurora
15 - Aurora

@munchkin100,

 

You can use DateTimeYear function as well.

 

messi007_0-1628684335493.png

 

Hope this helps.

 

Regards.

 

Labels