how to express absolute value in advanced settings in tFilter

One Star

how to express absolute value in advanced settings in tFilter

Hi, all
I want to construct a filter condition under advanced settings in tFilter. The condition is like:
for column1(type: BigDecimal) in Row2, if absolute value of column1 <=1 and column1 !=0. Could anyone help me to write this expression under advanced settings in tFilter?
Thanks a lot!
One Star

Re: how to express absolute value in advanced settings in tFilter

Hi
Because of BigDecimal type, the java code should type like this.
(input_row.columnName1.abs()).doubleValue()<3&&(input_row.columnName1.abs()).doubleValue()!=0

Hope this will help you.
Best regards!
Pedro
One Star

Re: how to express absolute value in advanced settings in tFilter

Hi,
When I tried to write the condition in the above format, I get the error as:
Exception in component tFilterRow_3
java.lang.NullPointerException
at talend_ccs.omega_generatepricetable_0_1.Omega_GeneratePriceTable.tPostgresqlInput_2Process(Omega_GeneratePriceTable.java:7942)
at talend_ccs.omega_generatepricetable_0_1.Omega_GeneratePriceTable.runJobInTOS(Omega_GeneratePriceTable.java:12677)
at talend_ccs.omega_generatepricetable_0_1.Omega_GeneratePriceTable.main(Omega_GeneratePriceTable.java:12545)
Any suggestions?
Thanks!
One Star

Re: how to express absolute value in advanced settings in tFilter

Hi
Please recheck tPostgresqlInput.
I'm afraid there is something wrong of your input flow.
Or upload the screenshot of your job and schema of tPostgresqlInput.
Best regards!
Pedro

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Downloads and Trials

Test drive Talend's enterprise products.

Downloads