Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Renaming a field in a table without reloading the table

Is it possible to do this?

It would make sense to say:

Rename field

     X

from

     Y

To

     Z

Unfortunately this from syntax does not seem to exist in this context.

Instead all fields are renamed, which causes problems if you want to rename only the field of one table.

I work with noconcatenated tables, so I work with independand data.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I solve this problem now by:

:

     NOCONCATENATE LOAD

          *,

          X AS 'Z'

     FROM

          [STH];

     DROP FIELD

          X

    

     FROM

          Y;

View solution in original post

4 Replies
klausskalts
Partner - Creator
Partner - Creator

Rename field X to Y;

Should Work ....

Anonymous
Not applicable
Author

It does not work, if a different table already has a field Y.

The fieldname was Z btw.

Furthermore it renames fields in other tables that are also called X to Z.

klausskalts
Partner - Creator
Partner - Creator

That's correct,

1) you cannot rename a field to a field name which already exists.

2) renaming a field will rename the field globally

But what is it you try to achieve?

One thing you might do is to utilize the ALIAS function. If you load all your Alias' in the beginning of the script then it should rename the fields as you go along.

Anonymous
Not applicable
Author

I solve this problem now by:

:

     NOCONCATENATE LOAD

          *,

          X AS 'Z'

     FROM

          [STH];

     DROP FIELD

          X

    

     FROM

          Y;