Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Linking tables with more than 1 KEY

I have the below table structure in my database:

double keys.PNG.png

But when I tried to load the data as it is into QlikView, it will create loops.

Is there any way I can load the data so that there will be no loops?

Maybe something like this?

syn.PNG.png

6 Replies
its_anandrjs

Remove the synthetic keys and make the composite key combinations like

Key1&'_'&Key2 as KeyA

Some thing like this

its_anandrjs

If Data A and Data B and Data C are same then concatenate the tables. If you have sample data then provide might be easy.

its_anandrjs

Load your like below for avoiding the synthetic keys

TableA:

Load

Key1&'_'&Key2 as Key,

Data A

From Location;

TableB:

Load

Key1&'_'&Key2 as Key,

Data B

From Location;

TableC:

Load

Key1&'_'&Key2 as Key,

Data C

From Location;

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this using Link table, by using this you can Key1 and Key2 as filters also.

TableA:

Load

Key1&'_'&Key2 as Key,

Data A

From Location;

LinkTable:

LOAD

Key1&'_'&Key2 as Key,

Key1,

Key2

From Location;

TableB:

Load

Key1&'_'&Key2 as Key,

Data B

From Location;

Concatenate(LinkTable)

LOAD

Key1&'_'&Key2 as Key,

Key1,

Key2

From Location;

TableC:

Load

Key1&'_'&Key2 as Key,

Data C

From Location;

Concatenate(LinkTable)

LOAD

Key1&'_'&Key2 as Key,

Key1,

Key2

From Location;

Regards,

Jagan.

Not applicable
Author

The method of using KEY1 + KEY2 = KEY cannot work as the key1 in each table is actually a date key. Which was linked to a calendar.

Sorry I miss this important information out eariler.

calendar2.PNG.png

I could do a month(date)+Key2 = key, but then I will not be able to keep the calendar.

vijetas42
Specialist
Specialist

Hi,

In above table structure you can rename fields in Table A,B,C and join these three tables on same key and then final output table join with calendar Table