Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Populating an empty table with data from a temp table

Hello all.  I have created an empty table using the LOAD * INLINE statement.  Now I simply want to take data from a temp table created previously and store certain values in this new empty table.  Here is my code so far:

tblTasks:

LOAD * INLINE [

    Task_Number, available

];

SELECT DISTINCT PSPLN

RESIDENT tblPull

ORDER BY PSPLN;

How do you "select into" the empty table from the the resident table?  Thanks!!!

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     For that you need to rename the field.

     Say for example you want to add data into Task_Number (As per your example)

     You should do something like below.

     Load DISTINCT PSPLN as Task_Number

     RESIDENT tblPull

     ORDER BY PSPLN;

     Also one point to not in the example you have given. You cannot use the Resident with Select Statement.

     Resident works only with load statement.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

5 Replies
Gysbert_Wassenaar

Your select statement needs to be a load statement because you want to get data from a resident table. You can add the data to tblTasks with the concatenate keyword:

tblTasks:
LOAD * INLINE [
    Task_Number, available
];

CONCATENATE(tblTasks)
LOAD DISTINCT PSPLN
RESIDENT tblPull
ORDER BY PSPLN;

Note,  it only retrieves distinct values of the PSPLN field. So what will happen is that a new field PSPLN will be added to tblTasks with the distinct values that are retrieved with the select statement. This doesn't make sense to me, so it's probably not what you want. Maybe you need to explain in more detail what should happen. An example document and sample data would be helpful.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thank you for the quick response Gysbert. How does QlikView know which field I want “PSPLN” to go into? Is it by the order they are listed in the code? Thanks.

Gysbert_Wassenaar

Because the name of the field is PSPLN. You didn't give the field another name, so Qlikview has to use that name.


talk is cheap, supply exceeds demand
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     For that you need to rename the field.

     Say for example you want to add data into Task_Number (As per your example)

     You should do something like below.

     Load DISTINCT PSPLN as Task_Number

     RESIDENT tblPull

     ORDER BY PSPLN;

     Also one point to not in the example you have given. You cannot use the Resident with Select Statement.

     Resident works only with load statement.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Thank you Kaushik.  This helps me understand it even better.