Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What is the correct syntax for 'Drop Field'

Hi

I'm using a load * but want to modify a few fields using drop field

 

Load

*,

  resident TableX;

Should drop field go after the resident TableX; line or before it? 

Also, when I'm adding the modified field back in, is this a separate load statement? 

This is my best guess at the moment, does it look close?

Load *,

resident TableX;

Drop Field FirstName;

Drop Field LastName;

FirstName & '_' & LastName AS FullName;

Thanks guys

1 Solution

Accepted Solutions
Gysbert_Wassenaar

By dropping fields this way you remove them completely from Qlikviews in-memory database. You can also drop them from only specific tables by adding From TableX, TableY. You can't use them anymore to create new fields. So create the new field first and drop the fields when you're really finished with them. Like this:

Load *, FirstName & '_' & LastName AS FullName;

resident TableX;

Drop Field FirstName;

Drop Field LastName;


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
er_mohit
Master II
Master II

ASD:

LOAD * INLINE [

    A, B, C, D

    1, 1, 1, 1

    2, 2, 2, 2

    3, 3, 3, 3

    4, 4, 4, 4

    5, 5, 5, 5

    5, 5, 5, 5

];

LOAD *

Resident ASD;

DROP Field A,B,C;

to using Drop field syntax

Drop Field Fieldname;

hope it helps

Gysbert_Wassenaar

By dropping fields this way you remove them completely from Qlikviews in-memory database. You can also drop them from only specific tables by adding From TableX, TableY. You can't use them anymore to create new fields. So create the new field first and drop the fields when you're really finished with them. Like this:

Load *, FirstName & '_' & LastName AS FullName;

resident TableX;

Drop Field FirstName;

Drop Field LastName;


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Yes, I agree with Wassenaar, just wanted to add...you can drop all fields in single statement as well.

drop fields FirstName,LastName from TableX;

Best,

SKumar