Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik View - Data Association Question

Hello,

I am brand new to Qlik View.

I am importing data from a SQL instance and the default associations created are incorrect. As far as I can tell, Qlik View creates associations between identically named fields in tables. The issue is, I have 40+ tables each using a field called "ID" as a PK so Qlik View is trying to create associations on this field (which is definitely not correct).

Is there a way I can clean this up using a tool like "Table Viewer" to redefine relationships, or, as I am beginning to fear, the only way to do this is to manually rename all sorts of fields in the import script? Really hoping there is a better way to do this!

Thanks in advance for your time and help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You could add this to your script before loading the data:

QUALIFY ID;

That will prefix every ID field with the name of the table it occurs in. You're then free to rename fields as needed to create the correct associations.

The other fields will not be prefixed. If you want to prefix all fields (generally not recommended) use QUALIFY *;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

You could add this to your script before loading the data:

QUALIFY ID;

That will prefix every ID field with the name of the table it occurs in. You're then free to rename fields as needed to create the correct associations.

The other fields will not be prefixed. If you want to prefix all fields (generally not recommended) use QUALIFY *;


talk is cheap, supply exceeds demand
vvvvvvizard
Partner - Specialist
Partner - Specialist

Rename the existing fields in the script  like this

Existing fieldname as new_fieldname ,

Anonymous
Not applicable
Author

Thanks Gysbert...I appreciate the quick response.

Unfortunately, I guess I'm stuck renaming fields!

I suppose what I am struggling with is I can understand the need to manually define relationships if I was talking about disparate data sources (for example, trying to relate a SQL table to an Excel file). However, when pulling data in from a single relational database where all of the relationships are already correctly defined, it seems rather inefficient to have to essentially redefine those relationships because a bunch of fields happen to share the same name.

I should mention this gets further complicated because a number of the tables also use a field called "Description" so Qlik View has set up all kinds of synthetic associations.

I just don't see name matching as a good basis for establishing data relationships (especially within a single relational database)..Just my 2 cents though.

Thanks again for confirming.