Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hierarchy Question

Hi all,

i have the following problem:

I one table i have two fields: Name, Location

In another table i have location information in a hierarchy structure. Lets take the following two tables as an example:

Users:

Name
Location
Smith1
Johnson2


Locations:

ID
Name
ParentLocation
0AMERICAS
1US0
2NA East1
3NA West1

What i want, is to add to the Users table the location information, so it looks like this:

Users:

Name
Location1
Location2
Location3
SmithAMERICASUSnot set
JohnsonAMERICASUSNA East

How can i do this ?

Thanks for some help.

K

1 Reply
hic
Former Employee
Former Employee

For example, you can do it the following way:

Locations:

Hierarchy (NodeID, ParentID, Location, ParentLocation, Location, Path, '/', Depth)

Load Autonumber(ID,'NodeID') as NodeID, Name as Location, Autonumber(ParentLocation,'NodeID') as ParentID inline

[ID, Name, ParentLocation

0, AMERICAS,

1, US, 0

2, NA East, 1

3, NA West, 1];

People:

Load Autonumber(Location,'NodeID') as NodeID, Name inline

[Name, Location

Smith, 1

Johnson, 2];

HIC