Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone, I have a basic doubt, first of all I have several tables that I have extracted from an excel file but these tables doesn't have Id fields in order to related between then so I decided to create these id fields, but how I can link one table with another. For example
Table A,
primary key
Table B
primary key
foreign key
how to set my primary key in the table A to the tabla B?
Qlik will join tables based on field names and Qlik is case sensitive. If the primary key for Table A was DEPTID and the primary key for Table B was DEPTID, Qlik would join the tables on DEPTID.
I did what you mention but the problem is that I have many tables with the same key, and my model shows like this:
TABLE A
ID_CAR
TABLE B
ID_CAR
TABLE C
ID_CAR
What you do in these scenarios is create on alias for the conflicting column, by example
TABLE A
ID_CAR As CAR_ID
TABLE B
ID_CAR As B_CAR_ID
TABLE C
ID_CAR As CAR_ID
TABLE D
ID_CAR As D_CAR_ID
Tables A and C share the same CAR_ID column, then Qlik join them, while Tables B and D (and any other table) have their own CAR_ID column, if you do not like so many aliases, you can also use Qualify to eliminate synthetic keys and your resolving the joins by renaming the required columns to a common name.
Hope this helps,
Maybe I did not explained very well, but the thing that I want is to load a Primary Key in another table, for example:
table CLIENT
ID_CLIENT
-
-
-
table ORDER
ID_ORDER
-
-
ID_CLIENT (I want lo load this field in this table)
I want to do in order to related them.
Well, we will expect that to be a common field between Orders and Customers; How are Customers and Orders associated in the current application, prior to getting its data in Qlik's QVDs; How are they join at the backend database?
HTH
Ok thanks, now I understand that the tables need to be related according to the common fields amount them. I thought that making an ID field was the only way to relate tables.