Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
FMDF
Contributor III
Contributor III

SQL Query conversion to QLIK Load

I have this query from an old app that I didn't build.  I'm converting it from QV to QS.

 

RA_CUSTOMER_TRX_ALL:

SQL
SELECT
DISTINCT
AR1.SOLD_TO_CUSTOMER_ID
,AR1.SHIP_DATE_ACTUAL
FROM
AR.RA_CUSTOMER_TRX_ALL AR1
WHERE
AR1.SHIP_DATE_ACTUAL IS NOT NULL
AND NOT EXISTS (
SELECT
DISTINCT
AR2.SOLD_TO_CUSTOMER_ID
,AR2.SHIP_DATE_ACTUAL
FROM
AR.RA_CUSTOMER_TRX_ALL AR2
WHERE
AR1.SOLD_TO_CUSTOMER_ID = AR2.SOLD_TO_CUSTOMER_ID
AND AR2.SHIP_DATE_ACTUAL < AR1.SHIP_DATE_ACTUAL
AND AR2.SHIP_DATE_ACTUAL >= TRUNC(ADD_MONTHS(AR1.SHIP_DATE_ACTUAL, - 35), 'MM')
);

 

Running this query as-is is brutally slow.  I think it will run faster if I convert it to a normal Qlik Load.

I have loaded 2 copies of the table RA_CUSTOMER_TRX_ALL (RA_CUSTOMER_TRX_ALL, RA_CUSTOMER_TRX_ALL2) into memory and want to replace this SQL query with normal Qlik Sense syntax.

I am completely stuck.

Labels (7)
0 Replies