Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
ahammadshafi
Creator
Creator

Creating hierarchy in data column

Dear Experts:

My client wants to view a table with a hierarchy (Region-> Sub-Region -> Country).

Table.PNG

But they all come in a single column, "Country".

Data.PNG

Please find attached sample data.

My question would be, what is the best approach to create the hierarchy while/after loading the data? And how should I create the table in desired format (with proper spacing, parent->child like Nordics-> Norway)?

Ahammad Shafi

1 Solution

Accepted Solutions
t_chetirbok
Specialist
Specialist

Hi!

Find attachment! !

It's hierarchy and pivot table, but I'm not sure that it is possible to do vertical pivot

View solution in original post

2 Replies
t_chetirbok
Specialist
Specialist

Hi!

Find attachment! !

It's hierarchy and pivot table, but I'm not sure that it is possible to do vertical pivot

View solution in original post

agustinbobba
Partner
Partner

Hi Ahammad,

First, you need to add the ID for the Node and the Parent. I attach the Excel file with the example.

Parent.png

Then you can use the Hierarchy Logic.

Aux:

LOAD Geo_Level,

     Country,

     ParentID,

     CountryID,

     Product,

     Type,

     Period,

     Value

FROM

[Sample Data.xlsx]

(ooxml, embedded labels, table is Data);

NoConcatenate

Hierarchy(CountryID, ParentID, Country)

LOAD Distinct

  CountryID,

  ParentID,

  Country

Resident Aux;

Table:

LOAD Geo_Level,

     CountryID,

     Product,

     Type,

     Period,

     Value

FROM

[Sample Data.xlsx]

(ooxml, embedded labels, table is Data);

drop Table Aux;

EXIT Script;

The result is something like that:

2016-03-21_12-40-47.png

Regards,

Agustin