Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
sarathi87k
Creator
Creator

how to Remove synthetic key

Table A

abc

Table B

dbe

table C

fbh

main

bhghij

Table A,b,c are connected with Main table and also with Table A

how to remove sythentic key without renaming and remove the field

1 Solution

Accepted Solutions
laddu_927
Specialist
Specialist

I think we can remove the sync keys by creating a combined key like showed in the attachment. But I seriously think you should change the schema of your tables as there is a high chance of sync keys and loops formations, Think you can denormalize your tables.

View solution in original post

10 Replies
vijayptcs
Creator II
Creator II

Try this

TableA:

LOAD * Inline

[

A,B,C

];

TableB:

LOAD * Inline

[

D,B,E

];

TableC:

LOAD * Inline

[

F,B,H

];

QUALIFY H ;

Main:

LOAD * Inline

[

B,H,G,I,J

];

Or share expected output.

neha_shirsath
Specialist
Specialist

Hi Sarthi,

How field name will be same in main table? (In your given sample example "h" field is repeated).

Is it same in your real data also?

Thanks,

Neha

rahulpawarb
Specialist III
Specialist III

Hello Sarathi,

As per my understanding, Table A is linked with Table B, Table C & Table main on field b; BTW, Table C is linked to main Table on field b & h fields. Considering this please refer below sample script to remove synthetic keys from present data model:

- Used QUALIFY statement for field b on Table C

- Created complex key on field b & h in Table C and Table main

[Table A]:

LOAD * INLINE [

a, b, c

];


[Table B]:

LOAD * INLINE [

d, b, e

];


QUALIFY b;

[Table C]:

LOAD f, b, b &'|' & h AS Key;

LOAD * INLINE [

f, b, h

];

UNQUALIFY b;


main:

LOAD b, g, i, j, b &'|' & h AS Key;

LOAD * INLINE [

b, h, g, i, j

];

P.S.: Field names must be unique within table main (field h is appeared two times).

Hope this will be helpful.

Regards!

Rahul

sarathi87k
Creator
Creator
Author

sorry i am beginner  this is real table

Customer Table

Customer ID,Customer name, Address

Contact Table

Customer ID ContactID,Contactname,Contact Address

Visit Table

CustomerID,ContactID,VisitID,Visit place,PotentialID

potential Table

PotentialID,CustomerID,ContactID,PotentialName

this is real table,how to remove synthetic key

rahulpawarb
Specialist III
Specialist III

Hello Sarathi,

Could you please share the relationship details between given tables (How one table linked with other table?) ?

Observation: Given table has two different naming style for field Customer ID & CustomerID. Please correct it if both field carries same value.

Regards!

Rahul

neha_shirsath
Specialist
Specialist

Hi Sarathi,

Considering your Customer ID & CustomerID same, attached the data model.

Hope it will help you.

Thanks,

Neha

sarathi87k
Creator
Creator
Author

sorry typing mistake its CustomerID

laddu_927
Specialist
Specialist

I think we can remove the sync keys by creating a combined key like showed in the attachment. But I seriously think you should change the schema of your tables as there is a high chance of sync keys and loops formations, Think you can denormalize your tables.

View solution in original post

sarathi87k
Creator
Creator
Author

in your Test.qvw ContactID is missing in potential table