Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Re: Rename filed names in same table

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

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Creator
Creator

Re: Rename filed names in same table

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

Highlighted
Champion III
Champion III

Re: Rename filed names in same table

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

];

Highlighted
Creator
Creator

Re: Rename filed names in same table

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

Highlighted
Creator
Creator

Re: Rename filed names in same table

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.

Highlighted
Champion III
Champion III

Re: Rename filed names in same table

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.

Highlighted
Creator III
Creator III

Re: Rename filed names in same table

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?

Highlighted
Creator
Creator

Re: Rename filed names in same table

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
Highlighted
Creator III
Creator III

Re: Rename filed names in same table

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.

Highlighted
Creator II
Creator II

Re: Rename filed names in same table

Hi,

May be something like this??

DEF.PNG

ABC.PNG

Thanks,