Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is Wrong?

whats wrong in this data model?

Is it correct that there is a syntactic key?

Modelo1.jpg

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you want to do away with the synthetic keys, create a complex key that concatenates the vlues from the three shared fields in a single (new) key field and drop the base fields from every table except the one containing the largest number of shared values (the superset). In case there is no superset table, you may need to create a LinkTable to make connections to the other tables work as expected. Otherwise you'll get unwanted filtering because of selections in tables with value subsets < 100%

Or - and this is usually better for performance - .put all Ventas, NotasDeCredito & Devoluciones in a single table and leave the key fields as they are. Add an identifier field that contains one of three possible strings, to tell you what type of row your are looking at.

View solution in original post

6 Replies
oknotsen
Master III
Master III

Yes, you have a synthetic key.

The top 3 tables have more than 1 field in common, so you get a synthetic key.

May you live in interesting times!
Michiel_QV_Fan
Specialist
Specialist

More information here: Synthetic Keys by hic

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you want to do away with the synthetic keys, create a complex key that concatenates the vlues from the three shared fields in a single (new) key field and drop the base fields from every table except the one containing the largest number of shared values (the superset). In case there is no superset table, you may need to create a LinkTable to make connections to the other tables work as expected. Otherwise you'll get unwanted filtering because of selections in tables with value subsets < 100%

Or - and this is usually better for performance - .put all Ventas, NotasDeCredito & Devoluciones in a single table and leave the key fields as they are. Add an identifier field that contains one of three possible strings, to tell you what type of row your are looking at.

buzzy996
Master II
Master II

if ur getting the expected values on ur reports with this data model then there is no problem with this synthetic key(because ur  having only one key in ur model)

if u have some data issues, u need to redefine the model like Peter suggested by creating complex key or by creating separate table for all key fields and map each individual keys with other tables.

Not applicable
Author

i did this:

solucion.jpg

what do you think?

Anil_Babu_Samineni

It's good for view

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful