Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Duplicate data in table created in script

Hello,

I'm having several issues with this script.

The first is that when I load this script, the IDs that get the Account No. added from the Peek(), get duplicated in the resulting data.

DomainAccountIDAccount No.
Company ASales61561521
Company ASales62591521
Company ASales6259-
Company ASales64591521
Company ASales6459-

I need to remove the data for ID that doesn't have the Account No. associated.

The second is that the Table NHDBID doesn't show up as its own table in Qlik Sense.  I don't know if that's adding to the problem, but I thought that the script would have created a Table called NHDBID, and maybe using Drop Table NHDB would fix the issue above.

The script I'm referring to is below:

NHDB:

Load

[ID],

Domain,

Account

resident ID;

Left Join

Load

[ID],

[Account No.]

Resident Sales;

NHDBID:

Load

Domain,

[ID],

If(IsNull([Account No.]),Peek([Account No.]),[Account No.]) as [Account No.],

Account

Resident NHDB

Order By Domain, [ID];

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Your tables NHDB and NHDBID gets auto-concatenated, due to the same field names in both tables.

Use NOCONCATENATE LOAD prefix to prevent QS from doing this, then drop table NHDB:

NHDB:

Load

[ID],

Domain,

Account

resident ID;

Left Join

Load

[ID],

[Account No.]

Resident Sales;

NHDBID:

NOCONCATENATE Load

Domain,

[ID],

If(IsNull([Account No.]),Peek([Account No.]),[Account No.]) as [Account No.],

Account

Resident NHDB

Order By Domain, [ID];

DROP TABLE NHDB:

View solution in original post

1 Reply
swuehl
MVP
MVP

Your tables NHDB and NHDBID gets auto-concatenated, due to the same field names in both tables.

Use NOCONCATENATE LOAD prefix to prevent QS from doing this, then drop table NHDB:

NHDB:

Load

[ID],

Domain,

Account

resident ID;

Left Join

Load

[ID],

[Account No.]

Resident Sales;

NHDBID:

NOCONCATENATE Load

Domain,

[ID],

If(IsNull([Account No.]),Peek([Account No.]),[Account No.]) as [Account No.],

Account

Resident NHDB

Order By Domain, [ID];

DROP TABLE NHDB: