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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Eliminate data in Load script

Hi,

I want to eliminate data containing "Total:" in both column A and Column B. Can I do this in Edit Script? Also how to eliminate blanks in the data. Attached is the data.

AML_Master:

LOAD A,

          B

FROM

C:\Users\Country.txt

(txt, codepage is 1252, embedded labels, delimiter is '|', msq);


Thank you in advance,

Jasmine

1 Solution

Accepted Solutions
puttemans
Specialist
Specialist

And for the blanks, you add

AML_Master:

LOAD A,

          B

          len(A) as LengthA,

          len(B) as LengthB

FROM

C:\Users\Country.txt

(txt, codepage is 1252, embedded labels, delimiter is '|', msq)

WHERE NOT Wildmatch(A,'*Total:') AND NOT Wildmatch(B,'*Total:');

AML_Master2:

LOAD *,

Resident AML_Master

WHERE LengthA <>0 OR LengthB<>0;

DROP TABLE AML_MASTER;

This will remove everything with a blank in either A or B, if you need it in both, then you need to use the AND operator.

Take care, length will be 0 if you have nothing in the cell, if you have e.g. a '-', it will be 1. Best to check the contents of LengthA/B first.

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

AML_Master:

LOAD A,

          B

FROM

C:\Users\Country.txt

(txt, codepage is 1252, embedded labels, delimiter is '|', msq)

WHERE NOT Wildmatch(A,'*Total:') AND NOT Wildmatch(B,'*Total:') ;


talk is cheap, supply exceeds demand
puttemans
Specialist
Specialist

And for the blanks, you add

AML_Master:

LOAD A,

          B

          len(A) as LengthA,

          len(B) as LengthB

FROM

C:\Users\Country.txt

(txt, codepage is 1252, embedded labels, delimiter is '|', msq)

WHERE NOT Wildmatch(A,'*Total:') AND NOT Wildmatch(B,'*Total:');

AML_Master2:

LOAD *,

Resident AML_Master

WHERE LengthA <>0 OR LengthB<>0;

DROP TABLE AML_MASTER;

This will remove everything with a blank in either A or B, if you need it in both, then you need to use the AND operator.

Take care, length will be 0 if you have nothing in the cell, if you have e.g. a '-', it will be 1. Best to check the contents of LengthA/B first.

Not applicable
Author

Thank you, Gysbert and Johan, for your quick response. They are very helpful.