I have a where clause
CreatedDate = THIS_YEAR or CreatedDate = LAST_YEAR
Is there a simple way of adding two years prior? I.e. “or” Two_years_prior? I need to pull current and two years prior
thank you in advance !
Hi @J054305 ,
You can create this range with the following formula:-
[This_Year]=ToNumber(DateTimeFormat(DateTimeToday(),"%Y"))
[Last_Year]=ToNumber(DateTimeFormat(datetimeadd(DateTimeToday(),-1,'year'),"%Y"))
Hope this helps.
Best,
Jagdeesh
Thank you, I need a formula to pull year 2020.
I currently have current and last year. Is there a simple “Last_2_years” where clause for alteryx?
Last_Year - 1
IN Clause
<= and >=
@J054305 you can the This -2 Year with this formula:-
[Last_Year]=ToNumber(DateTimeFormat(datetimeadd(DateTimeToday(),-2,'year'),"%Y"))
You can then use this in your where clause using the dynamic input tool.
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |