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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
mohamad
Contributor
Contributor

Null in Primary key (Qlik Compose)

We don’t have a primary key defined for some tables in the Oracle database. How should we handle these tables in Qlik Compose? Some of these tables contain NULL values in all columns, so we are unable to define a primary key. In this case, should we consider all columns together as a composite primary key?

Labels (1)
4 Replies
mohamad
Contributor
Contributor
Author

How to resolve this issue?

henrikalmen
Specialist II
Specialist II

If all columns contain NULL on some rows, those rows would not be able to have a composite key using all columns as the key itself would become null. But why would you want to load those completely empty rows at all?

You could create a composite key using all columns (unless all are null) but you would need to know that no two rows contain the exakt same values, unless you make sure you load only unique rows.

 

mohamad
Contributor
Contributor
Author

We have values in all columns, but NULL values are also coming from the source. In this case, I cannot select one or two columns as the primary key. Therefore, I would need to consider all columns together as a composite primary key. However, since NULL values are present in all columns, could you please advise how we should handle this in Qlik Compose?


This table does not have a primary key defined in the source database.

 

mohamad_0-1791100451688.png

 

henrikalmen
Specialist II
Specialist II

How are you going to use this table’s data? If you know that, you should be able to figure out what your key needs to be. 

A key based on all columns is kind of not a key, is it? Will it be usable? 

I actually don’t know how Qlik Compose works, but I know how QlikView and Qlik Sense handles keys between tables. There you could use for example hash256(col1name, col2name …) to create a key, or do something like  coalesce(col1name,’’)&’#’coalesce(col2name,’’)&’#’&… to make sure all columns are dealt with.