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

Copy Tables During Load

How do I copy a table loaded earlier in the text script?

My script is loading a table at the begining called Complaints. Later in the script I want to use a copy of that table, rename it and then  to do a join with another table.

I'm just not sure how to copy the Complaints table.

Thanks.

Jeff

4 Replies
Not applicable

Jeff,

You can use a Resident load to copy another table that is already loaded into Memory.

Complaints_Copy:

Load *

RESIDENT Complaints;

Not applicable

Remember, that your table loaded with Load * from resident x_table; will have exactly the same column names, and tables will be asociated to each other by all fields. If you really need all table 2'nd time you shoul consider if field names should not use QUALIFY or explicit change column names (as).

regards

Darek

whiteline
Master II
Master II

Hi.

If you want to join it you don't have to make a separate copy.

Suppose you want to left join all fields^

left join(sometable)

LOAD

     *

Resident Complaints;

maxgro
MVP
MVP

I suppose whiteline gave the answer

but if you want create a copy of Complaints


Complaints:

load

    field1,

    field2,

    ......

from

    ......;


..........

.........


//Complaints copy

// rename fields to avoid automatic concatenation or association, synthetic key, etc....

ComplaintsCopy:

load

    field1 as field1copy,

    field2 as field2copy,

    .......

resident

    Complaints;


// join

left join (ComplaintsCopy)

load

    ........

    .......

    ;