Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Where Not Exists and qualify

Hello,

I am unsuccessful in combining Not Exists and qualify/unqualify.

Goal: load a dataset and identify lines that have one field (or combinaton of fields) in common with previously loaded lines; in that case either not load the line (what I try to do here) or as an alternative load the line with a special flag telling it is a "duplicate".

If I do this :

table1:

    LOAD

        a,

        b

FROM

file.txt

(...)

where

    not exists(a);

It works fine, I have no duplicate lines for field a.

If I do this:

qualify*;

table1:

    LOAD

        a,

        b

FROM

file.txt

(...)

where

    not exists(a);

unqualify;


It doesn't work, I get an empty table.

If I do this :

qualify*;

table1:

    LOAD

        a,

        b

FROM

file.txt

(...)

where

    not exists(table1.a);

unqualify;


It doesn't work, I get an error message from the load telling the field table1.a cannot be found.

Any idea on how to solve this?.

1 Solution

Accepted Solutions
sunny_talwar

May be like this:

qualify *;

UNQUALIFY a;

table1:

LOAD * Inline [

  a, b

  A, 10

  A, 20

  A, 30

  ]

Where not exists(a);

unqualify *;

RENAME Field a to table1.a;

View solution in original post

2 Replies
sunny_talwar

May be like this:

qualify *;

UNQUALIFY a;

table1:

LOAD * Inline [

  a, b

  A, 10

  A, 20

  A, 30

  ]

Where not exists(a);

unqualify *;

RENAME Field a to table1.a;

Anonymous
Not applicable
Author

Thank you, this works.