Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
stefano_pernat
Contributor II
Contributor II

set primary key on loaded table

Hi all,

I'm new to QlikView,

is it possible to set a field explicitly as primary key on a loaded table in order to make an association with another table?

1 Solution

Accepted Solutions
sunny_talwar

For making joins between tables you need to give the field the same name in both the tables and QlikView will itself form the association. For instance:

Table1:

LOAD xyz,

        Date

FROM someTable.xlsx;

Table2:

LOAD xyz,

          Year

FROM anotherTable.xlsx

These two tables will automatically show a association on the field XYZ.

HTH

Best,

S

View solution in original post

5 Replies
sunny_talwar

For making joins between tables you need to give the field the same name in both the tables and QlikView will itself form the association. For instance:

Table1:

LOAD xyz,

        Date

FROM someTable.xlsx;

Table2:

LOAD xyz,

          Year

FROM anotherTable.xlsx

These two tables will automatically show a association on the field XYZ.

HTH

Best,

S

buzzy996
Master II
Master II

the above explanation is absolutely right,

if ur case is like this then u can try the below one,

Table1:

LOAD xyzaaaa as Key1,

        Date

FROM someTable.xlsx;

Table2:

LOAD xyz as Key1,

          Year

FROM anotherTable.xlsx

mukesh24
Partner - Creator III
Partner - Creator III

Hi stefno,

    above examples is right.. In qlikview if u want to do assosiation between 2 table simply alias field to common name.

For Ex:-

Student:

LOAD RollNo as Key1,

        StudDate

FROM Student.xlsx;

Mark:

LOAD SRN as Key1,

          Marks

FROM Marksheet.xlsx

Regards,

Mukesh Chaudhari

robert_mika
Master III
Master III

One more way when you have more that one column with the same name:

Do you Qualify?

hic
Former Employee
Former Employee

The bottom line is that QlikView doesn't care about which the primary key is. The only thing that matters, is what the name of the field is. If it is the same in two tables, it's a key. Full stop.

So make sure that

  1. you name keys the same in different tables.
  2. you name non-keys differently in different tables (e.g. fields like Comment, Remark, and Description)

HIC