Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Self referencing table

Good day everyone,

I'm currently trying to create a self referencing object, I have a table that represent a warehouse, which I load like this:

Warehouse:

LOAD id AS warehouse_id,

     name AS warehouse_name,

     warehouse_id;

SQL SELECT *

FROM 'db'.warehouses;

When loading the script this breaks. How can I load this type of tables.

Regards,

5 Replies
oknotsen
Master III
Master III

Your current script will fail as the Warehouse table you are trying to create can not have two columns with the same name.

Could you explain what you are trying to achieve? And I do not mean this technical solution, but the problem you are trying to solve.

May you live in interesting times!
dinuwanbr
Creator III
Creator III

Hi,

Can you upload a sample here....

Rgds,

Dinu1

Anonymous
Not applicable
Author

You cant use two same fields in one table, try with renaming one of the field

Warehouse:

LOAD id AS warehouse_id,

     name AS warehouse_name,

     warehouse_id;

SQL SELECT *

FROM 'db'.warehouses;

pljsoftware
Creator III
Creator III

Hello Aldo,

the correct answer is Re: Self referencing table by balrajahlawat.

In this case a best practice is to comment all fields and start to uncomment a field for each reload. If you do this always you can find which field generate the error.

Best Regards

Luca Jonathan Panetta

Clever_Anjos
Employee
Employee

QlikView does not allow two fields with same name

Please read this article, it can help you