hi, i have an issue to identify current year in the table.
Let say today is in 2017, but I want to identify 2016 as Current Year and then will be filtered out.
This workflow should be flexible with the update of the year. For example, if we are in 2018, the Current Year then will be 2017.
i have tried to use max function but seems it is not working.
Solved! Go to Solution.
Hi @azuzu
I have written it into one formula for you in the attached workflow.
The formula is:
IF
ToNumber(DateTimeFormat(DateTimeToday(),"%Y")) - [Year] = 1
Then "Yes"
ELSE "No"
ENDIF
To break it down, I used: DateTimeFormat(DateTimeToday(),"%Y") to get the year from today's date. I then need to ToNumber this as Alteryx treats dates as string values.
Then you can perform your if statement that you had previously.
Hopefully this helps.
Thanks
Joe
Hi,
You can use this expression and this will give you previous year as a result.
DateTimeFormat(DateTimeAdd(DateTimeNow(),-1,"Year"),"%Y")
Regards,
Vishwa
Hi @JoeS
I could not open your workflow as it shows an error due to different version. I am using v11.0
Hi @azuzu
No worries, I have changed it to version 11 for you now.
There is a link on the community about how to change them if you need it in future too:
https://community.alteryx.com/t5/tkb/articleprintpage/tkb-id/knowledgebase/article-id/854
Thanks
Joe
No problem, happy to help :)