Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
btrinh
Contributor II
Contributor II

Error at Rename statement while using partial reload

Hello,

I have a very simple script like this: 

 


[table1]
Replace Load *;
Select * From `database1`.`table1`;

Drop Field A;

Rename Field B to B_alias;

 

 

The script runs well with Full Reload.
However, if I run a Partial Reload, it fails at Rename with this error:

 

Error: The name 'B_alias' already exists.

 

Could someone please help me with this error? 

Labels (2)
3 Replies
vinieme12
Champion III
Champion III

if there already exists a field named "B_alias" in  a previously loaded table, then you will not be able to rename a second field to the same name

instead of renaming , try to load the same field twice and then drop the other field

 

for example

table1:

load B_alias

,Dim1,Dim2

From table1source;

 

table2:

load B as B_alias

,B as B2

,a1,a2

From table2source;

Drop field B2;

 

 

read limitations

https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptR...

 

Two differently named fields cannot be renamed to having the same name. The script will run without errors, but the second field will not be renamed.

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
btrinh
Contributor II
Contributor II
Author

No, there is no B_alias field in any other table, before or after this script. This script is still running without error with Full Reload; only with Partial Reload it fails. 

I am trying to optimize my run time using Partial Reload, so I need to understand why it causes error in this particular script.

vinieme12
Champion III
Champion III

Are you replacing the Table that has the B_alias field or another table that does not have B_alias field?

Partial Load will not drop existing tables from MEmory

so if you are replacing a table that does not have B_alias field means that B_alias exist in another table at the time of Partial Reload

 

a simple way to verify if B_alias exist in another table is to comment your rename field statement 

and at the end of the partial reload

>> create a Table chart

>> Add Dimensions =$Table

>> Add Dimensions =$Field

>>and check if B_alias exists 

 

 

 

[table1]
Replace Load *;
Select * From `database1`.`table1`;

Drop Field A;

//Rename Field B to B_alias;

 

 

 

 

The error message is very straight forward and is pointing out that a field named "B_alias" already exists in memory and won't allow you to rename another field with the same name.

 

https://help.qlik.com/en-US/sense/August2022/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptPrefix...

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.