Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
it remove the columns number 2,4,36
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
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
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.
Thanks Ivan!
Got it. But really confusing.
Yes.. Should be avoided. Very confusing.
regards,