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: 
Not applicable

Multiple 'Rename Fields' commands in script

Hi All,

I am trying to load two mapping loads and two tables and for field renaming purposes.

The problem I am having is if there is the same combination of Oldname and Newname in the two tables, the rename is not performed.


RenameBISHAUL:
MAPPING
LOAD PhyLayoutSeq,
PhyCode
FROM DWPhysicalLayoutRecord.qvd (qvd)
WHERE PhyLayoutCode = 'BIS-HAUL';

ALLLayout:
LOAD PhyTransSeqID,
PhyLayoutCode,
PhyAccountCode,
PhyTransDate,
PhyTransTime,
PhyTransBatchRef,
PhyTransLogin,
[1],
[2],
[3],
[4],
[5],
[6]
FROM
DWPhysicalTransRecord.qvd
(qvd)
WHERE PhyLayoutCode = 'BIS-HAUL';

Rename fields using RenameBISHAUL;


RenameSHOTGRADE:
MAPPING
LOAD PhyLayoutSeq,
PhyCode
FROM DWPhysicalLayoutRecord.qvd (qvd)
WHERE PhyLayoutCode = 'SHOT-GRADE';

SHOTGRADELayout:
CONCATENATE
LOAD PhyTransSeqID,
PhyLayoutCode,
PhyAccountCode,
PhyTransDate,
PhyTransTime,
PhyTransBatchRef,
PhyTransLogin,
[1],
[2],
[3],
[4],
[5],
[6]
FROM
DWPhysicalTransRecord.qvd
(qvd)
WHERE PhyLayoutCode = 'SHOT-GRADE';

Rename fields using RenameSHOTGRADE;



The problem is specifically in relation to column '[1]' in both tables. This column in both tables ALLLayout and SHOTGRADELayout refers to the same PhyLayoutSeq and PhyCode (1 and 'REC_TYPE').

How can I get around this issue?

A component of the resulting table looks as below (see REC_TYPE and [1] - I want these to concatenate to REC_TYPE).

error loading image

Thanks

1 Reply
Not applicable
Author

Perhaps I should clarify this.

The fields being renamed are the numeric fields.

The first rename mapping table (RenameBISHAUL) looks as follows:

1
REC_TYP
2
MIN_IDN_CON
3
MIN_IDN_SHF
4
MIN_TNE_HAU
5
MIN_IDN_PAD_FR
6
MIN_IDN_PAD_TO

The second mapping table (RenameSHOTGRADE) looks as follows:

1
REC_TYP
2
MIN_IDN_LOC
3
MIN_IDN_SHO
4
MIN_IDN_FLI
5
MIN_GR%_CU
6
MIN_GR%_CAM