Qlik Community

Ask a Question

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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.

0 Replies