Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!!!
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
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.
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.
Because the name of the field is PSPLN. You didn't give the field another name, so Qlikview has to use that name.
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
Thank you Kaushik. This helps me understand it even better.