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.
Not applicable

Isolate Duplicate Key Field

I need to create a resident table in my data model that contains all the rows in Temp2 that contain a duplicated LoadNumber.  In this example, 1237, 100 ; 1237, 150.0 ; 1241, 75 ; 1241, 100.0 ;  1241, 125 ;  1241, 250.  I have tried a variety of joins and experimented with EXISTS, but I'm not obtaining the table I need.  Any suggestions will be greatly appreciated!

Temp2:

LOAD * INLINE [

    LoadNumber, ManifestClass

    1234, 50

    1235, 100

    1236, 75.0

    1237, 100

    1237, 150.0

    1240, 250

    1241, 75

    1241, 100.0

    1241, 125

    1241, 250

];

Thanks,

Steve

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

Re: Isolate Duplicate Key Field

Temp2:

LOAD * INLINE [

    LoadNumber, ManifestClass

    1234, 50

    1235, 100

    1236, 75.0

    1237, 100

    1237, 150.0

    1240, 250

    1241, 75

    1241, 100.0

    1241, 125

    1241, 250

];

left join (Temp2)

load LoadNumber,

if(count(LoadNumber)>1, 'DUPLICATE', 'OK') as flag

Resident

Temp2

group by LoadNumber;

1.png

2 Replies
MVP
MVP

Re: Isolate Duplicate Key Field

Temp2:

LOAD * INLINE [

    LoadNumber, ManifestClass

    1234, 50

    1235, 100

    1236, 75.0

    1237, 100

    1237, 150.0

    1240, 250

    1241, 75

    1241, 100.0

    1241, 125

    1241, 250

];

left join (Temp2)

load LoadNumber,

if(count(LoadNumber)>1, 'DUPLICATE', 'OK') as flag

Resident

Temp2

group by LoadNumber;

1.png

Not applicable

Re: Isolate Duplicate Key Field

Massimo,

That is excellent!

Thank you,

Steve

Community Browser