I have an Oracle query that I need to rewrite in WebI. I cannot figure out how to mimic the NOT EXISTS
from Oracle. My query returns an object if it has a transaction date within a given time frame, but not if it has anything prior to that time frame. That is, something like:
SELECT Object_Number
, Transaction_Date
, <other fields>
FROM Object_Table
INNER JOIN Transaction_Table ON Transaction_Table.Key = Object_Table.Key
WHERE Transaction_Table.Date BETWEEN '2017-07-01' AND '2017-01-31'
AND NOT EXISTS (SELECT 1 FROM Transaction_Table
WHERE Transaction_Table.Key = Object_table.Key
AND Transaction_Table.Date < '2017-07-01'
)
It's a bit more complex, but that is a good approximation.
I thought I could use a subquery filter, but I don't see how to tie that subquery to the original Object_Number
or how to mimic that NOT EXISTS
. I don't think a NOT IN
is the same as NOT EXISTS
because the record complex in the universe includes the transaction_date
(it is basically a JOIN of the Object_Table
and the Transaction_Table
), so all I'd be checking is that the date that I have on my current record (a date inside the range) is not outside the range. I'm sure that this filter subquery can do more, but that I am not understanding it.
I cannot find any complex filter examples (despite many that claim to be "complex" - they have 3 "AND" statements - oooohhhh!).
I think it can be accomplished with a new dimension in the universe [using MIN(Transaction_Date)]
, but that path is not available to me.
It seems to me that without this type of basic functionality (at least it's basic in Oracle SQL), this WebI tool is severely limited.