Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Load past two days in Input Tool (Oracle Database)

ehellblom
6 - Meteoroid

Hi,

 

I am trying to restrict my Input tool to only load the past two day from the Date column via a SQL query.

It is an Oracle Database stored on the Gallery, my current query scans the whole table but it is a large table causing performance issues for other functions so need to find the most efficient way.

 

Does anyone have a good query you have been using or perhaps a better way to load in last two days from a database than the SQL query in Input Tool?

 

Current Query looks like this:

Where [DATE] in (select t2.DATE from (select t1.DATE, rank() over (Order By t1.DATE Desc) As rank From (Select Distinct DATE from SOURCE(t1))t2 where t2.RANK<=2)

 

Thank you in advance!

2 REPLIES 2
Qiu
21 - Polaris
21 - Polaris

@ehellblom 
Searched on the internet and find something like below should be helpful.

where date_submitted >= cast(dateadd(day, -2, getdate()) as date)
and   date_submitted < cast(getdate() as date)
echuong1
Alteryx Alumni (Retired)

You can also try using a formula to derive the dates, and a dynamic input to update the data parameters. Use replace a specific string and update the specific portions of the where clause.

 

echuong1_3-1607964583165.png

 

 

echuong1_0-1607964522106.pngechuong1_1-1607964543784.png

 

Labels
Top Solution Authors