Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

Delete a field

Hello,

Actually I tried to manage my database and I wanted to know how can I delete an entire field.

Header 1Header 2Header 3

Field 1

User 1PWD 1
Field 2User 2PWD 2
Field 3user 3PWD 3

If I delete Field 2:

Header 1Header 2Header 3
Field 1User 1PWD 1
Field 3User 3PWD 3

Regards

Tags (3)
1 Solution

Accepted Solutions
Arjunarao
Honored Contributor II

Re: Delete a field

Hi KennyHua

We can not delete any field from data model. But we can do following:

1. We can not select the field in SELECT statement

2. We can comment the field

3.We can use DROP Field FieldName from TableName statement.

Hope this will help you.

View solution in original post

12 Replies
sasiparupudi1
Honored Contributor III

Re: Delete a field

you can use dropfiled function

drop Field YourField;

Employee
Employee

Re: Delete a field

Do you mean data you have loaded into QlikView?

If you loaded it as Table1:

Table2:

Load * resident Table1 where Header1 <> 'Field2';

Drop Table1;

veidlburkhard
Contributor III

Re: Delete a field

Hi Kenny,

seems you want to delete one row and not  a field. If so you can use the file wizard and easily delete the marked row or chose a conditon to conditionally delete it:

DeleteRow.jpg

Hope this helps

Burkhard

sasiparupudi1
Honored Contributor III

Re: Delete a field

Hi

If you want to delete a row in an already loaded table, you could only use another resident load excluding the problem row.

I suggest you go wiith the solution given by

Employee
Employee

Re: Delete a field

That's how I interpreted it based on the data example, that it was a row to be deleted.

Not applicable

Re: Delete a field

It's very interesting, but do you know if it's possible de keep the column name ? Because actually when I take your way, Each column is replaced by @1, @,2 and I want to keep Header 1, Header 2, ...

I don't want to creat alias because I have a lot of table to manage

Regards

veidlburkhard
Contributor III

Re: Delete a field

Hi Kenny,

no need to create aliases. Simply click on embedded lables. See below

DeleteRow.jpg

Regards

Burkhard

Not applicable

Re: Delete a field

Hi,

Sorry to keep asking you, but I got something different with your picture:

DELETE:

  LOAD

  Header 1,

  Header 2,

  Hearder 3

  FROM

  [..\DATA\TABLES - Copie\COUNTRY.qvd]

  (qvd, filters(

  Remove(Row, Pos(Top,$(vNB_OF_ROW)))

));

And I got with the Wizard:

delete.PNG

Regards

Employee
Employee

Re: Delete a field

I still think it would be easier to do it in a resident load

INPUT:

  LOAD

  Header 1,

  Header 2,

  Hearder 3

  FROM

  [..\DATA\TABLES - Copie\COUNTRY.qvd]

  (qvd);


DELETE:

Load * resident INPUT where Header1 <> 'Field2';

Drop Table INPUT;