Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What am I doing wrong in this resident load - drop table?

Hi,

I'm just testing a simple Resident load of a table called 'Sales01', then I want to load it into a table called 'Sales'.

After it has been loaded into 'Sales', I'd like to drop 'Sales01', but it seems to be dropping both tables in this case.

I've attached the sample qvw.

Any ideas as to why this isn't working?

Many thanks!!

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

When two tables anywhere in the script share the same number of fields and all fields are named alike, the second one is concatenated implicitly to the previous one, resulting in one bigger table. And that's exactly what it's happening to you. So when you DROP the first table you are dropping actually both LOADs, because they are concatenated. Just using NOCONCATENATE keyword in the second LOAD will avoid this.

Sales01:

LOAD * INLINE [

    ID, USDSales, USDMargin, USDCost

    A, 100, 1, 10

    B, 500, 2, 20

    C, 300, 3, 90

    D, 200, 4, 30

    E, 400, 5, 60

];

Sales:

NOCONCATENATE LOAD ID, USDSales, USDMargin, USDCost

RESIDENT Sales01;

DROP TABLE Sales01;

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

EDIT: For your perusal, this is documented in the Reference Manual Book I, Section 23.7 "Automatic Concatenation"

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hi,

When two tables anywhere in the script share the same number of fields and all fields are named alike, the second one is concatenated implicitly to the previous one, resulting in one bigger table. And that's exactly what it's happening to you. So when you DROP the first table you are dropping actually both LOADs, because they are concatenated. Just using NOCONCATENATE keyword in the second LOAD will avoid this.

Sales01:

LOAD * INLINE [

    ID, USDSales, USDMargin, USDCost

    A, 100, 1, 10

    B, 500, 2, 20

    C, 300, 3, 90

    D, 200, 4, 30

    E, 400, 5, 60

];

Sales:

NOCONCATENATE LOAD ID, USDSales, USDMargin, USDCost

RESIDENT Sales01;

DROP TABLE Sales01;

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

EDIT: For your perusal, this is documented in the Reference Manual Book I, Section 23.7 "Automatic Concatenation"

Not applicable
Author

Thanks!