Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Synthetic key in table structure

 

Hi

 

who can help me to dissolve a synthetic key?

 

There are 5 tables (Equipment, Wartungsaufträge, Arbeitsvorbereitung, Werkskalender, Arbeitsplätze) related with each other tables.

 

The table Arbeitsplatz with key [Arbplatz] exists in the tables Equipment, Wartungsaufträge and Arbeitsvorbereitung. The work calendar has a key [KEY_Dat1] and the Arbeitsplätze a key [Arbplatz].

 

The result should be that in the table Arbeitsvorbereitung both keys [Arbplatz] / [KEY_Dat1] and Wartungsaufträge also the keys [Arbplatz] / [KEY_Dat1] exist. Unfortunately, I cannot dissolve the key.

 

In picture 2 shows how the connection should look.

 

Regards
Stefan

 

5 Replies
Anonymous
Not applicable
Author

concatenate the two fields causing the sythetic key in both of the tables, then in one table remove the individual fields, so in table Arbeitsvorbereitung you have 3 fields:

'Concatenated field'

Arbplatz

KeyDAT1

and in the other table you just have the concatenated field

m_s
Partner - Creator II
Partner - Creator II

You just need to drop the ArbPlatz Field from the Wartungsauftraege table. Just add the following statement to the end of the script or see the attached .qvw-File.

DROP FIELD ArbPlatz FROM Wartungsauftraege;

Anonymous
Not applicable
Author

Many thanks, but I need ArbPlatz in table Wartungsauftraege, so I have a relationship between Wartungsauftraege and Arbeitsplätze.

Anonymous
Not applicable
Author

Try the attached...

m_s
Partner - Creator II
Partner - Creator II

Try creating a link table then :

WAAPLink:

LOAD DISTINCT

  ArbPlatz & '|'  & KEY_Dat1 AS keyLink,

  ArbPlatz,

  KEY_Dat1

Resident Wartungsauftraege;

Concatenate(WAAPLink)

LOAD DISTINCT

  ArbPlatz & '|'  & KEY_Dat1 AS keyLink,

  ArbPlatz,

  KEY_Dat1

Resident Arbeitsvorbereitung;

left join(Wartungsauftraege)

LOAD

  ArbPlatz,

  KEY_Dat1,

  ArbPlatz & '|'  & KEY_Dat1 AS keyLink

Resident Wartungsauftraege;

left join(Arbeitsvorbereitung)

LOAD

  ArbPlatz,

  KEY_Dat1,

  ArbPlatz & '|'  & KEY_Dat1 AS keyLink

Resident Arbeitsvorbereitung;

DROP FIELD KEY_Dat1, ArbPlatz FROM Arbeitsvorbereitung, Wartungsauftraege;