Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
vincentmecrin
New Contributor III

Line duplication SQL Select


Hello,

I'm extracting a table from SQL and the generated table has duplicated lines. The SQL table has no duplicated lines.

I only running the following script, no table before or after and no join just the database connection before.

Item:

LOAD *;

SQL SELECT *

From MDTestDatabase.SAP.ViewItem;

if i use a ditinct, i have the following results:

- LOAD Distinct *: no duplication

- SQL SELECT Distinct *: duplications

So, duplication is generated by LOAD statement and not SQL query.

Any idea?

Thks

1 Solution

Accepted Solutions
vincentmecrin
New Contributor III

Re: Line duplication SQL Select

I have found the problem.

There are 3 and 000003 as item code and Qlikview change the first in 000003.

Vincen

4 Replies

Re: Line duplication SQL Select

Omit the LOAD *; It doesn't do anything, or rather - it isn't supposed to do anything. The Item-table will be created by just executing the SQL SELECT

Weird phenomenon. Are you sure the View isn't populated with too many lines?

Peter

vincentmecrin
New Contributor III

Re: Line duplication SQL Select

I have found the problem.

There are 3 and 000003 as item code and Qlikview change the first in 000003.

Vincen

MVP
MVP

Re: Line duplication SQL Select

It's hard to believe that SQL SELECT Distinct or LOAD Distinct will give a resultset with duplicate rows. Maybe it's related to an associated table in the model?

Could you upload an example?

- Ralf

MVP
MVP

Re: Line duplication SQL Select

Use

LOAD

     text(FIELD) as FIELD,

     ...

if you need to distinguish between 3 and 000003

Community Browser