Alteryx Designer Desktop Discussions

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

Filter in DataBase

nicktekippe
8 - Asteroid

I need a formula to filter a date in DB. I am pulling the data from SAP HANA. The dates being formatted is in YYYY-MM-DD format.  I need to filter the dates to be from today to two years ago from today. Please let me know if there is any more information I can provide.

4 REPLIES 4
MatthiasSeil
Alteryx Alumni (Retired)

When entirely staying In-DB here, you'd need some SQL know how in order to achieve this:

 

I'd do the following:

 

1. Use the In-DB formula to create a new column with the date two years ago from today:

MatthiasSeil_0-1626361842288.png

2. Filter the new date column with your existing date column with the In-DB filter (larger than 2 years ago and smaller than today or equal):

MatthiasSeil_0-1626362485119.png

 

 

 

 

If that solves your task, please mark this as a accepted solution as it helps Alteryx to keep the statistics about open and solved topics, thanks!

 

Kind regards

 

Matthias

 

nicktekippe
8 - Asteroid

@MatthiasSeil I attempted this but received an error for the Formula tool.

nicktekippe_0-1626362544990.png

 

MichaelSu
Alteryx Alumni (Retired)
nicktekippe
8 - Asteroid

nicktekippe_0-1626438982743.png

 

Labels