Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Remove() function in filters

Hi,

I am going through a script which loads data from .csv file. Script contains "Remove()" function in the filters and I an unable to comprehend the usage and syntax. Can somebody help me on this?

Code Extract:

Load

.....

.....

FROM

O1.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq, filters(

Remove(Col, Pos(Top, 2)),

Remove(Col, Pos(Top, 4)),

Remove(Col, Pos(Top, 36))

));

Thanks a lot!

rishu

1 Solution

Accepted Solutions
Not applicable

Remove() function in filters

Hi there, I think the remove function uses reference indexes for the column to be removed, for instance, if you have a table containing ten columns, and you remove number 9, then you table will have 9 columns now, and your former column 10 will be column 9 now, so if also want to remove the former column 10, you will also have to add another remove pointing to column 9.

I hope I was clear enough, it is a bit tricky.

Regards

6 Replies
lironbaram
Honored Contributor II

Remove() function in filters

it remove the columns number  2,4,36

Not applicable

Remove() function in filters

Thanks for reply!

Code contains some lines like below. Why it will be required to remove column 7,9 twice and 5 times!! Any idea?

Remove(Col, Pos(Top, 2)),

Remove(Col, Pos(Top, 4)),

Remove(Col, Pos(Top, 7)),

Remove(Col, Pos(Top, 7)),

Remove(Col, Pos(Top, 9)),

Remove(Col, Pos(Top, 9)),

Remove(Col, Pos(Top, 9)),

Remove(Col, Pos(Top, 9)),

Remove(Col, Pos(Top, 9))

regards,

rishu

Not applicable

Remove() function in filters

Hi there, I think the remove function uses reference indexes for the column to be removed, for instance, if you have a table containing ten columns, and you remove number 9, then you table will have 9 columns now, and your former column 10 will be column 9 now, so if also want to remove the former column 10, you will also have to add another remove pointing to column 9.

I hope I was clear enough, it is a bit tricky.

Regards

danielrozental
Honored Contributor II

Remove() function in filters

Remove filters are inserted when you use the transformation wizard when reading a file.

I try to avoid them honestly, I find it's way more clear just to remove columns from the load or add where clauses when possible.

Not applicable

Remove() function in filters

Thanks Ivan!

Got it. But really confusing.

Not applicable

Remove() function in filters

Yes.. Should be avoided. Very confusing.

regards,

Community Browser