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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Same column name in different table results in Incorrect data by producing synthetic key


I have a scenario where , there are two table

Table A:

Id , Doc Type, Is Required , Comments

IDDoc TypeIs RequiredComments
1Doc 1Yes
1Doc 2Yes
2Doc1Yes
2Doc3Nowill be provided later

Table B:

Id , Doc Type, Doc Name , Location

IDDoc TypeDoc NameLocation
1Doc1test.docxD:/User
1Doc2test1.docxD:/User
1Doc4test2.pdfD:/User
2Doc2test3.pdfD:/User
2Doc3test4.txtD:/user

Table A is Rule table which displays what all documents are needed for a particluar Id

Table B holds actual documents attached for Corresponding Id. One can attached any document

I need to Create two tables with same structure in Qlikview , and a filter Doc Type. When user select a  Doc Type from filter or click any Doc Type in any  table ,  both table should show data for that Doc Type only (for all related Ids). Ex: when Doc2 is selected

1 row from table A and 2 rows from table B get displayed.

When I am writing the query , it is generating synthetic keys and data is coming incorrect. Some rows gets filter out.

Please suggest an approach to do this.

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I would join these two tables rather than creating separate tables in your model unless there is a huge difference in the cardinality of the tables.

If you keep them separate, you will get a synthetic key to handle the multifield association. This is not an error, and should not cause any serious problems. But if you want to get rid of the synthetic key, you can create a compound key using something like

     [ID] & '-' & [Doc Type]

You should create the key in the table loads for both tables, and choose which table should not also load the ID and Doc Type. This approach works if one table contains all the possible IDs and Doc Types.

BTW - this is simply doing manually what QV is doing automatically with the synthetic key. And that is why I would join the tables, if at all possible.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein