Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
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

Re: Linking tables with more than 1 KEY

Remove the synthetic keys and make the composite key combinations like

Key1&'_'&Key2 as KeyA

Some thing like this

Re: Linking tables with more than 1 KEY

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.

Re: Linking tables with more than 1 KEY

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;

MVP & Luminary
MVP & Luminary

Re: Linking tables with more than 1 KEY

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

Re: Linking tables with more than 1 KEY

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.

vijetasharma
Valued Contributor

Re: Linking tables with more than 1 KEY

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