Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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
Honored Contributor III

Re: Self referencing table

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
Contributor III

Re: Self referencing table

Hi,

Can you upload a sample here....

Rgds,

Dinu1

balrajahlawat
Esteemed Contributor

Re: Self referencing table

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
Contributor III

Re: Self referencing table

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

Employee
Employee

Re: Self referencing table

QlikView does not allow two fields with same name

Please read this article, it can help you

Community Browser