Alteryx Designer Desktop Discussions

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

Update year in a filter based on current year-1 using datetimenow

hash_89
8 - Asteroid

I would need to update a filter to 'current year - 1'. Is there a way to do it with using 'datetimenow'?

Capture23.PNG

How can i connect this to update 'Filter' with this 'Year' value? Can someone help me on this?

 

My intention of using 'datetimenow' is because i don't want to manually add anything to my workflow before i schedule it.

 

Thanks.

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @hash_89 

 

You can use the DateTimeYear function.

 

DateTimeYear(DateTimeNow()) - 1

 

Cheers,

Thableaus
17 - Castor
17 - Castor

@hash_89 

 

How's your filter setup?

 

Cheers,

hash_89
8 - Asteroid

Hi,

 

I have certain input coming through. The filter which has year = 2019 should dynamically change to 'Current year -1'. I have two different pieces now and I'm looking for ways to connect them both either through interface or other means.

Capture25.PNG

 

Thableaus
17 - Castor
17 - Castor

@hash_89 

 

You don't need the Action tool for that.

 

In the Filter Tool, select the Custom Filter Option.

 

[year] = DateTimeYear(DateTimeNow()) - 1

 

Done, you'll have what you desire.


Cheers,

hash_89
8 - Asteroid

Thankyou.

Labels