Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
nsm1234567
Creator II
Creator II

Joining tables where data in a single column

Hi There,

I'm wondering if someone can perhaps help me improve a script I'm writing.  My data is set out something like the below

High Level CodeCodeDescription
9011712Agent
712512Agent_Household

The desired output is as follows:

Business CodeAttributeSub AttributeAttribute CodeSub Attribute Code
9011AgentAgent_Household712512

What I'm currently doing is loading the first table in twice.  When it loads a second time, I rename the fields so that e.g. High Level Code becomes "code" which allows me to join the two tables.  Is there not a better way to do this though?  Any help would be appreciated.

2 Replies
simenkg
Specialist
Specialist

You should look into the Hierarchy() function.

petter
Partner - Champion III
Partner - Champion III

Simens suggestion is good - an alternative solution could be to do an inner join (not let the associative model do an outer join) with the resident table - which should be very efficient compared to loading the table twice from the source.

Like this:

2015-03-06 #1.PNG