Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulgoyal1287
Contributor III
Contributor III

Output of two ODBC queries gets merged while uploading the data in Qlik

Hello All,

Could anyone help me here in solving the problem where I wish to keep 2 separate tables based on status however qlik appends the data in one single table which is not recommended by my process. Here is the queries being used in Data Load manager -

LIB CONNECT TO 'IMDD_PROD_64 (internal_rgoyal)';

OHS_ENTERED_ORDERS:
SQL
SELECT * FROM SERVORDPROPROD1..T_OPS_OHS_DATA
WHERE UPPER(D_STATUS) = 'ENTERED'
AND D_MONTHX >= (select add_months(to_date((extract (year from current_date)) || '0101','YYYYMMDD'),-12));

And then

LIB CONNECT TO 'IMDD_PROD_64 (internal_rgoyal)';

OHS_COMPLETED_ORDERS:
SQL
SELECT * FROM SERVORDPROPROD1..T_OPS_OHS_DATA
WHERE UPPER(D_STATUS) = 'COMPLETED'
--AND UPPER(D_ORDER_ORIGIN) = 'CUSTOMER'
AND D_MONTHX >= (select add_months(to_date((extract (year from current_date)) || '0101','YYYYMMDD'),-12));

I am somehow aware about the noconcatenation clause however I am not sure how can it be used.

thanks for the help!!

4 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

You are posting in a forum called "New To QlikView". However, it seems to me that you are using Qlik Sense. To get quicker and more to the point responses, please consider moving your question to a Qlik Sense forum.

Just follow the steps outlined here: QlikCommunity Tip: How to move your discussion thread

_k0zm0_2
Contributor III
Contributor III

Hello Rahul.

If you don´t want to concatenate tables, you can use NoConcatenate

LIB CONNECT TO 'IMDD_PROD_64 (internal_rgoyal)';

OHS_ENTERED_ORDERS:

Load

    *

;
SQL
SELECT * FROM SERVORDPROPROD1..T_OPS_OHS_DATA
WHERE UPPER(D_STATUS) = 'ENTERED'
AND D_MONTHX >= (select add_months(to_date((extract (year from current_date)) || '0101','YYYYMMDD'),-12));

OHS_COMPLETED_ORDERS:

NoConcatenate

Load

    *

;

SQL

SELECT * FROM SERVORDPROPROD1..T_OPS_OHS_DATA

WHERE UPPER(D_STATUS) = 'COMPLETED'

--AND UPPER(D_ORDER_ORIGIN) = 'CUSTOMER'

AND D_MONTHX >= (select add_months(to_date((extract (year from current_date)) || '0101','YYYYMMDD'),-12));

I would prefer to generate a fact table with a Origin field

LIB CONNECT TO 'IMDD_PROD_64 (internal_rgoyal)';

OHS_ORDERS:

LOAD

    *

    ,'Entered' as Origin
SQL
SELECT * FROM SERVORDPROPROD1..T_OPS_OHS_DATA
WHERE UPPER(D_STATUS) = 'ENTERED'
AND D_MONTHX >= (select add_months(to_date((extract (year from current_date)) || '0101','YYYYMMDD'),-12));

Concatenate( OHS_ORDERS)

LOAD

    *

    ,'Customer' as Origin

;

SQL
SELECT * FROM SERVORDPROPROD1..T_OPS_OHS_DATA
WHERE UPPER(D_STATUS) = 'COMPLETED'
--AND UPPER(D_ORDER_ORIGIN) = 'CUSTOMER'
AND D_MONTHX >= (select add_months(to_date((extract (year from current_date)) || '0101','YYYYMMDD'),-12));

With this option, you have only one table, avoiding synthetic keys and you can get any value (with Set Analysis, por example)

rahulgoyal1287
Contributor III
Contributor III
Author

Thanks for the response.

However could we save the output in 2 different tables if possible for specific reasons - there are few fields which are there however calculated only for Completed orders.

_k0zm0_2
Contributor III
Contributor III

Of course you can have 2 output tables, using NoConcatenate.

Maybe this post can help you to understand it better

NoConcatenate