Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Loading all fields and changing one

Hi!

I have the following issue. I need to load all fields from a QVD file where I need to change one of them. To keep the script adaptive to the adding and removing of fields I would like to use the * instead of the field names. After I have changed one of the fields the table needs to be concatenated to another table. Any ideas of doing this without to many temporary tables? Ideally the script would look something like this:

Concatenate Load

     * (without field x),

     field x

From

     temp.QVD;

Thanks for any help!

5 Replies
vijay_iitkgp
Valued Contributor

Loading all fields and changing one

Hi,

You can write

Load

*,

Field x as Field y

from temp.qvd;

Drop Field x

rename field Field y to Field x;

Hope this will help

Re: Loading all fields and changing one

Good one Vijay,

Even faster if you do the RENAME only one:

Data:

LOAD * // x field is here as "original"

FROM File.qvd (qvd);

RENAME FIELD original TO x;

Hope that helps.

Miguel

Not applicable

Loading all fields and changing one

Thanks for your answer. This still requires me to do a concatenate and drop table statement. Is there an easier way to concatenate the table after I have renamed the field?

Not applicable

Loading all fields and changing one

Thanks for your answer. I need to manipulate the original field so I will need the step in between.

vijay_iitkgp
Valued Contributor

Loading all fields and changing one

I dont know if I understand correctly

but U can do:

Load

*,

Field x as Field y

from temp.qvd;

Drop Field x;

rename field Field y to Field x;

Concatenate

Load

*

from temp2.qvd;

Community Browser