Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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;