Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
stefan_fischer
New Contributor II

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
adrianbuzer
Contributor II

Re: Synthetic key in table structure

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_schindler
Contributor II

Re: Synthetic key in table structure

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;

stefan_fischer
New Contributor II

Re: Synthetic key in table structure

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

adrianbuzer
Contributor II

Re: Synthetic key in table structure

Try the attached...

m_schindler
Contributor II

Re: Synthetic key in table structure

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;

Community Browser