Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Choose current year

terrellchong
8 - Asteroid

Hi, I have a set of data that needs to filter out for current year.

 

I had inputted 

[Year]=ToNumber(DateTimeFormat(DateTimeToday(),"%yyyy"))

 into the filter but it doesn't seems to filter out 2020 (aka current year) for me. 

My data here [Year] are Int16 type.

terrellchong_0-1593761154537.png

 

Which part did I screw up?

 

3 REPLIES 3
LordNeilLord
15 - Aurora

Hey @terrellchong 

 

Try this instead:

 

[Year]=ToNumber(DateTimeFormat(DateTimeToday(),"%Y"))
terrellchong
8 - Asteroid

Thanks!! 😃

hshandilya
7 - Meteor

Modify the formula- The correct format for yyyy in Alteryx is %Y

 

[Year]=ToNumber(DateTimeFormat(DateTimeToday(),"%Y"))

 

 It is working perfectly fine for me.

Labels