Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

IN-DB Filter all except previous day

Brawlstrogg
7 - Meteor

Hi all,

 

I'm trying to pull out some data from our Oracle databases where the records are authorised on the previous day. Usually I'd just say '01-Jan-2017' but that date needs to always be the previous day EXCEPT for where it's a Monday and then it needs to be Friday-Sundays dates.

 

Any ideas?

 

There doesn't appear to be a date filter on the IN-DB tools is all...

4 REPLIES 4
SGolnik
11 - Bolide
11 - Bolide

Have you tried writing a SQL (case) statement using the Filter in-DB tool?

jdunkerley79
ACE Emeritus
ACE Emeritus

Assuming a field of 'UpdateDate' something like:

 

UPDATEDATE >= TRUNC(CASE WHEN to_char(sysdate,'D') in (1,2,7) then next_day(sysdate-7, 'Friday') else sysdate-1 end)
AND UPDATEDATE < TRUNC(sysdate)

Should get you the records only on the prev business day

Brawlstrogg
7 - Meteor

<DELETED>

Brawlstrogg
7 - Meteor

Legend. Working as needed.

 

Thanks!

Labels