Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
priya945
Creator
Creator

Rename filed names in same table

Hi All,

I have one Table with two columns as below

   

Test
ColumnAColumnB
AD
BE
CF

Loading in QV script as

   

Test:
Load
ColumnA
ColumnB
From Test;

Requirement is to have single columnA with all the values from both columns as below. Please suggest   

ColumnA
A
B
C
D
E
F
19 Replies
micheledenardi
Specialist II
Specialist II

Test:

Load

    ColumnA

From Test;


Concatenate(Test)

Load

    ColumnB as ColumnA

From Test;


Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
priya945
Creator
Creator
Author

Thank you Michele for your quick reply.

I am making changes in a data models that is already built so using above method id disturbing the data Model so please any other method where I can rename my field name 

shiveshsingh
Master
Master

Are these fields associated with the model? What is the key?

You can left your model as it is and create one separate table with concatenated columns as suggested.

priya945
Creator
Creator
Author

Hi Shivesh,

Please find my data and please suggest how to rename Region as Sub-continent or copy Region values to Sub-continent

Test:
LOAD * Inline [
Product, Sales ,Continent, Sub-continent, Region
A, 1, APAC, India, SriLanka
B, 2, Europe, UK , Ireland
C, 3, Australia, Aus, Aus
]
;

Test:

Load
AutoNumberHash128
(Product) as %Product_Key,
AutoNumberHash128((Continent),(Sub-continent)) as %Con_Key,
 
Product,
Sales,
Continent,
Sub-continent,
Region
From Test;

andrey_krylov
Specialist
Specialist

Hi Priya. Maybe this

Test:

LOAD * Inline [
Product, Sales ,Continent, Sub-continent, Region
A, 1, APAC, India, SriLanka
B, 2, Europe, UK , Ireland
C, 3, Australia, Aus, Aus
]
;

Outer join(Test)

Load Product, Sales ,Continent, Region as [Sub-continent]

Resident Test; Drop Field Region from Test;

jyothish8807
Master II
Master II

May be like this also: Not sure what you are trying to achieve:

Test:
LOAD * Inline [
Product, Sales ,Continent, Sub-continent, Region
A, 1, APAC, India, SriLanka
B, 2, Europe, UK , Ireland
C, 3, Australia, Aus, Aus
]
;


Noconcatenate

Test1:

Load
AutoNumberHash128
(Product) as %Product_Key,
AutoNumberHash128((Continent),(Sub-continent)) as %Con_Key,
 
Product,
Sales,
Continent,
Sub-continent
From Test;


concatenate

Load
AutoNumberHash128
(Product) as %Product_Key,
AutoNumberHash128((Continent),(Sub-continent)) as %Con_Key,
 
Product,
Sales,
Continent,
Region as Sub-continent
From Test;


Drop Table Test;


Br,

KC

Best Regards,
KC
priya945
Creator
Creator
Author

Hi KC,

Thank you for your suggestion but with your method(Concatenation) some of the values are getting double

Please suggest any alterative if possible

Regards,

Priya

jyothish8807
Master II
Master II

I am still not clear what do you mean by "rename Region as Sub-continent or copy Region values to Sub-continent"


While doing like this, either region values will be overwritten by Sub-continent values or vice versa.


Can you please share your expected output.


Br,

KC

Best Regards,
KC
shiveshsingh
Master
Master

So you need Region and Sub continent column with same values?