Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need to make Primary key

I'm a beginner to qlikview.  Have loaded three xlsx file in QVW document, all the three xlsx file have one common field.

However, it is not seen as Primary key.  Also, in the Table viewer, fields like '$Syn1', '$Syn3' are showing

How to remove this 'Syn' field and how to make the common field as primary key

18 Replies
oknotsen
Master III
Master III

In Qlik, there is no such thing as a "primary key". There are fields and they are related. There is no technical need for something called "primary key".

A relation between two tables is only allowed to be based on one field. If not, Qlik will make Syn(thetic) keys to fix this problem.

May you live in interesting times!
Not applicable
Author

Thanks for the update.  The data is for two period and it is coming in two separate rows.  I need it in a single row for each unique entity e.g. entity ABC should be in one for Period 1 and Period 2.  Right now it is coming as ABC Period 1 in first row and ABC Period 2 in second row.

danansell42
Creator III
Creator III

Depending on your data it would probably be best to either join or concatenate 2 of the tables in order to remove the synthetic keys.

Not applicable
Author

Qlikview joins the table on the basis of column name. Synthetic keys are created when two or more table have more than one common column name. It slow down the performance of application.

How to Removed Synthetic keys:

- Renaming a fileds use( As) ex: Customer as %Customer

-comment out unneccesary fields ex: // Customer,

-Concatenating fields to create single composite key.

jjbom1990
Creator
Creator

What you can do is give each table their own table1ID, table2ID, TableNID.

you can do this by adding this to the script '1' as Table1ID or something similar.

Then you create a fact table which connects all the tables together.

more info can be found here:

Qlik Tips: Rules for creating a Key/Link Table in QlikView

and here

Concatenate vs Link Table

Anonymous
Not applicable
Author

Hi

You can remove syn keys with renaming field name or if it is not required comment those fields

Hope it helps

Not applicable
Author

Thanks, how do I do this.

Also, I have posted one more query, how to show records in single row for same entity if the data is for two period

tyagishaila
Specialist
Specialist

By which field you want to link all excel sheets, make sure that field name must be same in all load.

If you share sample data than things can be clear more.

Anonymous
Not applicable
Author

Hi,

Check if the common field has the EXACT same name (no spaces etc.) in your spreadsheet.  If not, rename the fields in your load script.

This will prevent QV from creating synthetic keys like '$Syn1'.

Regards.