Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to use tfilterrow

Hi
I'm a new talend's user.
I have 1 excel file (input) and 1 excel file (out put) - very simple
I want to filter a column by numeric and by text.
For numeric, it's OK - it's ==
But, for the text filter, it's a real problem for me. I try to do a "like" because my text begin by "impaye.....". I want every line with "impaye..." begin.
I hope somebody understand me.
My english is too bad.
Thanks you
Labels (2)
6 Replies
Anonymous
Not applicable
Author

Try a tFilter like this one....
0683p000009MCZU.jpg
Anonymous
Not applicable
Author

Thanks you
I did like your example by i have this error :
Starting job export_00 at 09:08 06/08/2008.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method StartsWith(String) is undefined for the type String
at test.export_00_0_1.export_00.tFileInputExcel_1Process(export_00.java:2390)
at test.export_00_0_1.export_00.runJobInTOS(export_00.java:2978)
at test.export_00_0_1.export_00.main(export_00.java:2893)
Job export_00 ended at 09:08 06/08/2008.
Anonymous
Not applicable
Author

Why don't you try spelling it with a lower case "s" : startsWith instead of StartsWith ?
Anonymous
Not applicable
Author

Ok I changed Starts by starts. But, A new message error :
Starting job export_00 at 09:49 06/08/2008.
Exception in component tFilterRow_1
java.lang.NullPointerException
at test.export_00_0_1.export_00.tFileInputExcel_1Process(export_00.java:2390)
at test.export_00_0_1.export_00.runJobInTOS(export_00.java:2978)
at test.export_00_0_1.export_00.main(export_00.java:2893)
Job export_00 ended at 09:49 06/08/2008.
Anonymous
Not applicable
Author

It appears that some of the rows in your input data have an empty field (in the column that you're filtering). You can use a try catch to reject the rows in which the field is empty.
I would make a routine with the method startsWithImpaie(String).
It could be like this :
public static boolean startsWithImpaie(String field) {
try {
return field.startsWith("impaye");
}
catch ( NullPointerException npe ) { return false; }
}
And then call it in my tFilterRow like this :
routineName.startsWithImpaie(row1.Column5)
Anonymous
Not applicable
Author

I have an Excel spreadsheet and I want to ONLY retrieve rows for two types of references.

Reference = "A", "AB", "D","FF"....

 

I only want rows where Reference IN ("A", "FF").  Plus, once I have the rows who match I want to use t Map in order to massage the information into an output file

Can this be accomplished using tFilterRow

 

 

KUDOS