Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exclude a list from Load script

Hi,

Hope you could help. 

How do I exclude a certain list of IDs from loading?

I have the following script:

LOAD [Id],

     [TimeStamp],

     [Total Count],

     [Info1]

     [Info2]

     [New ID]

FROM

(txt, utf8, embedded labels, delimiter is ',', msq);

I would like to exclude a list of [New ID], stored in C:\newID.csv]

THe file contains about 3million records, not "," delimited.  Just a list of IDs. 

Could you pls help? THanks in advance.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Changing 2nd part of my code to

LOAD @1

FROM

(txt, utf8, no labels, delimiter is ',', msq);

------------------------

it just hangs

Write this portion as

Load   @1 as timePersonnel

FROM

(txt, utf8, no labels, delimiter is ',', msq);

It should work.

Thanks.

View solution in original post

15 Replies
tresesco
MVP
MVP

a quick idea (may be a better one is there) :

Temp:

LOAD [Id],

     [TimeStamp],

     [Total Count],

     [Info1]

     [Info2]

     [New ID]

FROM

(txt, utf8, embedded labels, delimiter is ',', msq);

LEFT Join

Load [New ID] as [Id],

        'Y' as Flag

From C:\newID.csv;

Final:

Load *,

          '1' as Jnk

Resident Temp WHERE Flag<>'Y' ;

Drop Table Temp;

Drop Field Jnk, Flag;

Hope this helps.

tresesco
MVP
MVP

Sorry, you have to use LEFT JOIN instead of join.

Not applicable
Author

I have 2 IDs in my original file, [id] and [New ID].  how do i left join?

I would like to load the data where [NewID] in source file is same as [NewID] in my new criteria list.

Also, what is the flag?

tresesco
MVP
MVP

i should have noticed that. please find the changes in the earlier post in bold.

Not applicable
Author

Load [New ID] as [Id],

        'Y' as Flag

From C:\newID.csv;

Final:

Load *,

          '1' as Jnk

Resident Temp WHERE Flag<>'Y' ;

Drop Table Temp;

Drop Field Jnk, Flag;

   Q1: Do i use join or left join?

Q2:  I do not have Flag field in my file. all i have is a list of new id, not separated by commas.\

How should the script be like?

Not applicable
Author

To be sure, the newID field in main file, is combined from the ID+Timestamp

Directory;

Temp:

LOAD [Id],

     [TimeStamp],

     [Total Count],

     [Info1]

     [Info2]

     [Id] &'-'& [Timestamp] as [New ID]

FROM

(txt, utf8, embedded labels, delimiter is ',', msq);

Load [New ID]

        'Y' as Flag

From C:\newID.csv;

Final:

Load *,

          '1' as Jnk

Resident Temp WHERE Flag<>'Y' ;

Drop Table Temp;

Drop Field Jnk, Flag;

----------------------------------------------

I encounter this error:

Field not found - NewID

LEFT Join

Load imsiTime,

        'Y' as Flag

From

----------------------------------------------

To be sure, the formats are as below:

Source file:

IdTimestampTotal CountInfo1Info2
18am


28am


38am


NewID
1-8am
2-8am
3-8am

My final file should only output 1-8am and the parameters

Not applicable
Author

I think i have solved my join statement.

Now i have this error:

Table not found

FINAL:

Load *,

          '1' as Jnk

Resident Temp WHERE Flag<>'Y'

Can someone pls help?


Not applicable
Author

What about Where Not Exists.

Please see attached Example.

Hope this helps.

Not applicable
Author

is it possible to copy the script?

So sorry because i am using a personal edition.