Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Talk to Experts Tuesday, Live Q&A, September 22: Moving from QlikView to Qlik Sense. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist II
Specialist II

How to Drop field values while loading script

Hi All,

How to Drop field values while loading script

Ex: Field has values like A,B,C,D,E,F.....Z, i want to drop filelds 'C','D','E' from the field without using of WHERE/WHERE exists condition.

Thanks,

Nihhal.

11 Replies
Highlighted
Creator II
Creator II

any specific reason for not using where/ where exists?

Highlighted
Creator II
Creator II

hi.,

just comment the unnecessary fields....

then they don't come to front end.

Highlighted
Creator II
Creator II

Is there any reason for not using any functions..

Highlighted
MVP & Luminary
MVP & Luminary

You could also use a keep/join to filter a table like:

load KEY, further fields ... from MainTable;

     inner join

load KEY from FilterTable;

But what speaks against using a where-condition?

- Marcus

Highlighted
Champion III
Champion III

Use a preceding load with an If but any links to those deleted values will have Nulls. For Example:

Value column 3, 4,5 values will have Nulls in their respective Name field.

LOAD Col1,

          IF(Not Match(Name, 'C', 'D', 'E'), Name) AS NameFiltered;

LOAD * INLINE [

Value, Name

1, A

2, B

3, C

4, D

5, E

6, F

];

Highlighted
Specialist
Specialist

in script

Drop fields A,B from <Yourtablename>;

Highlighted
Champion III
Champion III

Hello Das,

I believe what Nihhal meant here is Field values rather than Fields. It might be typo!

"Ex: Field has values like A,B,C,D,E,F.....Z, i want to drop filelds (should have been drop values) 'C','D','E' from the field without using of WHERE/WHERE exists condition."

Highlighted
Specialist
Specialist

Oops. Main question would be why not use Where clause. Any reason for not using it??

Another solution

Table:

Load distinct

IF(Not Match(Name, 'C', 'D', 'E'), Name) AS NameFiltered;

From yourtablename

left Join

Load *

Name as NameFiltered

from yourtablename;

Highlighted
Contributor II
Contributor II

Use PURGECHAR

Syntax:

PurgeChar(text, remove_chars)