Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Droping tables in the script

Hi,

I created 4 qvd's and pulled into another qvw file, but not sure where to drop the tables in the script.

ALL:

LOAD * from IMF.qvd(qvd);

JOIN LOAD * from WIF.qvd(qvd);

JOIN LOAD * from DIL.qvd(qvd);

JOIN LOAD * from DIH.qvd(qvd);

//DROP TABLE IMF;

//DROP TABLE WIF;

//DROP TABLE DIL;

//DROP TABLE DIH;

FINAL:

LOAD * RESIDENT ALL;

//DROP TABLE ALL;

I see ALL after executing the script, but I suppose to see FINAL table in the table viewer. And where to drop the tables?

Thanks,

14 Replies
rustyfishbones
Master II
Master II

Should you not be storing the ALL tables into a new QVD and then dropping the tables?

So

ALL:

LOAD * from IMF.qvd(qvd);

JOIN LOAD * from WIF.qvd(qvd);

JOIN LOAD * from DIL.qvd(qvd);

JOIN LOAD * from DIH.qvd(qvd);

STORE ALL INTO ALL.qvd(qvd);

//DROP TABLE IMF;

//DROP TABLE WIF;

//DROP TABLE DIL;

//DROP TABLE DIH;

FINAL:

LOAD * RESIDENT ALL;

//DROP TABLE ALL;

Clever_Anjos
Employee
Employee

If you´re joining you don´t need to drop original tables

FINAL:

LOAD * RESIDENT ALL;

FINAL will not be generated because share same fields from ALL, so QlikView will concatenate records to ALL table

eduardo_sommer
Partner - Specialist
Partner - Specialist

The problem is that your Load * from ALL, concatenates the result to the ALL table, ignoring the FINAL name. You can use a Noconcatenate Load * Resident All to prevent this. This will correct your script.

This is Qlikview's behavior (to concatenate tables with the same structur, unless you explicitly uses noconcatenate)

Eduardo

eduardo_sommer
Partner - Specialist
Partner - Specialist

Clever is right. I couldn't see the need to load the data again.

Eduardo

MK_QSL
MVP
MVP

ALL:

LOAD * from IMF.qvd(qvd);

JOIN LOAD * from WIF.qvd(qvd);

JOIN LOAD * from DIL.qvd(qvd);

JOIN LOAD * from DIH.qvd(qvd);

STORE ALL into ALL.qvd (QVD);

Drop Table ALL;

FINAL:

Load * FROM ALL;

=========================

Hope this helps..

Peter_Cammaert
Partner - Champion III
Partner - Champion III

No, this isn't "QlikView behavior" because QlikView should respect the different table name (per the documentation). It's an unfortunate effect that QlikTech refuses to fix for a very long time. For one reason or another...

But of course you're right. Add NOCONCATENATE to the FINAL table LOAD statement and the problem fixes itself.

I don't know why but we seem to keep adding keywords and statements to otherwise straightforward grammar-compliant scripts that succumb to side-effects...

Not applicable
Author

Thanks All,

The reason behind using FINAL is I am creating few calculated fields.

ALL:

LOAD * from IMF.qvd(qvd);

JOIN LOAD * from WIF.qvd(qvd);

JOIN LOAD * from DIL.qvd(qvd);

JOIN LOAD * from DIH.qvd(qvd);

STORE ALL INTO ALL.qvd(qvd);

DROP TABLE ALL;

FINAL:

LOAD *,

few calculated fields here

RESIDENT ALL;

Got error message table not found, Even I tried with Load *, calculated fields from ALL;

Didn't work???

Thanks,

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Well after you drop table ALL, then it's no longer resident. You would need a load from the qvd rather than from a resident table.. Or else use NoConcatenate as per several replies, and drop ALL after the resident load.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
its_anandrjs
Champion III
Champion III

When you create one QVD based on four table files and create single table as ALL then after this call ALL.qvd not ALL which is in the application and as you use Drop table ALL it will not found. So open the ALL.qvd and make calculated fields see the load statement

ALL:

LOAD * from IMF.qvd(qvd);

JOIN LOAD * from WIF.qvd(qvd);

JOIN LOAD * from DIL.qvd(qvd);

JOIN LOAD * from DIH.qvd(qvd);

STORE ALL INTO ALL.qvd(qvd);

DROP TABLE ALL;

Noconcatenate //This is optional try top check while i believe not used here but try

FINAL:

LOAD *,

few calculated fields here

From ALL.qvd(qvd);