Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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

View solution in original post

6 Replies
lironbaram
Partner - Master III
Partner - Master III

it remove the columns number  2,4,36

Not applicable
Author

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
Author

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
Master II
Master II

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
Author

Thanks Ivan!

Got it. But really confusing.

Not applicable
Author

Yes.. Should be avoided. Very confusing.

regards,