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: 
Sebastian_Dec
Creator II
Creator II

Load * Resident Drop table from Data Warehouse

Hi, I'm trying to prepare data from a warehouse.
I want to download data for 2022/2023 and I use a temporary table for this and then delete it.
Unfortunately, there is no data in the new table, I don't know what I'm doing wrong, because the code seems correct, please help.

Table "sales" is empty. I try load first 10000 and I have some data in "sales_tmp"

LIB CONNECT TO 'HD';

First 10000
sales_tmp:
LOAD
hid_sklep,
date(hid_data) as data,
Year(hid_data) as year,
Month(hid_data) as month,
kod_ean,
hid_segment;

SELECT
"hid_sklep",
"hid_data",
"kod_ean",
"hid_segment"
FROM "public"."sales_72"
;

sales:
LOAD *
Resident sales_tmp
;
Drop table sales_tmp;

 

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.
Labels (2)
3 Solutions

Accepted Solutions
rubenmarin

Hi, if you load a table with the same fields as the previous laoded tabla, qlik will do an autocontenation, setting the new rows of the first table, you can avoid this using 'NoConcatenate' before the load:

sales:
NoConcatenate LOAD *
Resident sales_tmp

View solution in original post

marcus_sommer

Tables with the same data-structure are automatically concatenated. Means in your case no tables sales is created else this load is added to the sales_tmp which is afterwards deleted and therefore no data exists. This could be avoided with the load-prefix of noconcatenate. But in your case the extra resident-load is superfluous and you could save resources if you skip this part. 

View solution in original post

BrunPierre
Partner - Master
Partner - Master

Hi, the NoConcatenate prefix forces two loaded tables with the same set of fields to be treated as two separate internal tables, otherwise they will be automatically concatenated.

LIB CONNECT TO 'HD';

First 10000
sales_tmp:
LOAD
hid_sklep,
date(hid_data) as data,
Year(hid_data) as year,
Month(hid_data) as month,
kod_ean,
hid_segment;

SELECT
"hid_sklep",
"hid_data",
"kod_ean",
"hid_segment"
FROM "public"."sales_72"
;
NoConcatenate
sales:
LOAD *
Resident sales_tmp
;
Drop table sales_tmp;

View solution in original post

4 Replies
rubenmarin

Hi, if you load a table with the same fields as the previous laoded tabla, qlik will do an autocontenation, setting the new rows of the first table, you can avoid this using 'NoConcatenate' before the load:

sales:
NoConcatenate LOAD *
Resident sales_tmp
marcus_sommer

Tables with the same data-structure are automatically concatenated. Means in your case no tables sales is created else this load is added to the sales_tmp which is afterwards deleted and therefore no data exists. This could be avoided with the load-prefix of noconcatenate. But in your case the extra resident-load is superfluous and you could save resources if you skip this part. 

BrunPierre
Partner - Master
Partner - Master

Hi, the NoConcatenate prefix forces two loaded tables with the same set of fields to be treated as two separate internal tables, otherwise they will be automatically concatenated.

LIB CONNECT TO 'HD';

First 10000
sales_tmp:
LOAD
hid_sklep,
date(hid_data) as data,
Year(hid_data) as year,
Month(hid_data) as month,
kod_ean,
hid_segment;

SELECT
"hid_sklep",
"hid_data",
"kod_ean",
"hid_segment"
FROM "public"."sales_72"
;
NoConcatenate
sales:
LOAD *
Resident sales_tmp
;
Drop table sales_tmp;

Sebastian_Dec
Creator II
Creator II
Author

Thx, You all for helping me 🙂

Thanks & Regards,
Please close the thread by marking correct answer & give likes if you like the post.