Skip to main content
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
Anil_Babu_Samineni

Can you post or clarify your expected result, Instead simple Table? that would help

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
priya945
Creator
Creator
Author

Hi Anil,

Thanks for your response, please find below data and my requirement

   

Fact1
ProductSales

Continent

Sub-continent

A

3APAC India
E5APAC India
B 2Europe UK
C 7Australia Aus
D8Ameicas

USA

   

Fact2
ProductSales

Continent

Sub-continentRegion

A

1APAC IndiaBengaluru
E2APAC IndiaHyd
B 2Europe UK Ireland
C 3Australia AusAus
D5AmeicasUSAUSA

Two Fact table, I am concatenating as below with keys to dimension tables

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


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

Requirement: How to handle Region field so that I can show the all Region field values in Sub-continent field as below

         

Sub-continent
India
UK
Aus
USA
Bengaluru
Hyd

vishsaggi
Champion III
Champion III

Are you looking for this?

You create those key fields in the below load tables.

Capture.PNG

IF yes, you can try like

Fact1:

LOAD * INLINE [

Product, Sales, Continent, Sub-continent

A,  3, APAC, India

E, 5, APAC, India

B, 2, Europe, UK

C, 7, Australia, Aus

D, 8, Ameicas,USA

];

Fact2:

LOAD * INLINE [

Product, Sales, Continent,Sub-continent

A,  1, APAC,     India

E, 2, APAC,     India

B, 2, Europe,     UK

C, 3, Australia, Aus

D, 5, Ameicas, USA

];

RegionFact:

LOAD * INLINE [

Product, Sales, Continent, Sub-continent

A,  1, APAC, Bengaluru

E, 2, APAC, Hyd

B, 2, Europe, Ireland

C, 3, Australia, Aus

D, 5, Ameicas, USA

];

priya945
Creator
Creator
Author

Hi Vishwa,

Thanks for reply but you are missing Region field from my data. Please use my data and provide me some solution if possible

vinod22kv
Creator
Creator

Hi

Do the above script in new qvw and store this in to qvd and call that qvd in your final qvw.

Thanks and Regards,

Vinod.

vishsaggi
Champion III
Champion III

Sorry i mean the third table where you see sub-continent i have renamed the region to sub-continent. Ok can you tell me what is your expected output with field names and values can you provide us.

jensmunnichs
Creator III
Creator III

I'm pretty confused. Is it that you want [Sub continent] and [Region] to be displayed in a single listbox to make selections from? Or do you need [Region]  to replace [Sub continent] in script if the field exists?

priya945
Creator
Creator
Author

Expected out Concatenated Fact Table where Region field value are now in Sub-continent field

   

Fact1
ProductSales

Continent

Sub-continent

A

3APAC India
E5APAC India
B 2Europe UK
C 7Australia Aus
D8AmeicasUSA

A

1APACBengaluru
E2APACHyd
B 2Europe Ireland
C 3AustraliaAus
D5AmeicasUSA
jensmunnichs
Creator III
Creator III

I think if you just change this

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


To this


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


You should have what you want. This completely drops the original Sub-continent field in the second fact table and replaces it with the region field.

satishqlik
Creator II
Creator II

Hi,

May be something like this??

DEF.PNG

ABC.PNG

Thanks,