Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use composite key to remove synthetic key ?

how to use composite key to remove synthetic key ?

am new to qlikview am using personal edition.

1 Solution

Accepted Solutions
oknotsen
Master III
Master III

Combine both fields into one field.

Example:

OrderID & '-' & LineNo as OrderLineID

May you live in interesting times!

View solution in original post

6 Replies
oknotsen
Master III
Master III

Combine both fields into one field.

Example:

OrderID & '-' & LineNo as OrderLineID

May you live in interesting times!
stabben23
Partner - Master
Partner - Master

If thoose sync keys is key values, then just add Key1 &'|'& Key2. do this in all tables which should be connected to each other.This is Your Fields that is sync keys.

If you for example have sync keys on fieldnames that is dimensionvalues,then just rename the Field in one of the tables.

avinashelite

Combine the keys and create a new key as okg‌ mentioned , a point to add

rename the common filed otherwise again it will lead to synthetic key

E.G:

filed1&'-'&filed2&'-'&filed3 as Key,

field1 as tablename_filed1,

field2 as tablename_filed2,

field3 as tablename_filed3,


rahulpawarb
Specialist III
Specialist III

Hello Dinesh,

Please refer below links:

Synthetic keys vs. AutoNumber() (- concatenation)

This will help you resolve your queries.

Regards!

Rahul

oknotsen
Master III
Master III

Sorry Avinash, but in my opinion that is actually a bad idea.

That way you would add more fields to your data model that have the same content. If something is the same thing, it should have the same name, plus it would eat more memory as needed as Qlik now needs to keep track of the same valuess twice.

A better solution would be to remove the the initial fields from one of the two tables so you can still make selections on the individual fields but also no longer get a syn. key.

May you live in interesting times!
avinashelite

Yes , I agree but if you want to have certain data from specific table and if the other table does't have that data then ? we won't get that metric data rite.

I think we should design this  according to the client requirements

Hope  I answered your question