Double conditions tFilterRow

Highlighted
Six Stars

Double conditions tFilterRow

Hello,

 

I want to test 2 conditions with the tFilterRow component, but it don't work.

 

This is my job :

tFileList_1 :

directory : "D:/SPC/FichienSensibilite"

files : "*.dat"

tFileInputDelimited_1 :

flow's name :

((Strint)globalMap.get("tFileList_1_CURRENT_FILEPATH"))

tFilterRow_1 :

 

condition

Freq    Vide    Vaut   "Fréquence=1000Hz"

Freq    Vide    Vaut   "Temps=50µs"

Run IF :

condition :

((Integer)globalMap.get("tFilterRow_1_NB_LINE_OK")) > 0

tFileCopy_1 :

 

file's name :

((String)globalMap.get("tFile_1_CURRENT_FILEPATH"))

directory : "D:/SPC/test"

 

 

For my tFileInputDelimited_1 component, I use a metadata delimited file wich is form :

Colonne0

Date=20151202

Fréquence=1000Hz

Temps=50µs

 

Information

 

Colonne0 is a String type.

Do you have an idea to test two results on the same column ? Can you help me, please ?

 

Best regards

BastienM

 

PS : My job is in French


Accepted Solutions
Highlighted
Sixteen Stars
Sixteen Stars

Re: Double conditions tFilterRow

Keep a logical test with "OR" and change the condition before tFileCopy to:

((Integer)globalMap.get("tFilterRow_1_NB_LINE_OK")) == 2

The condition will be satisfied only for file where both records exist ("Fréquence=1000Hz" AND "Temps=50µs")

 


TRF

View solution in original post


All Replies
Highlighted
Seven Stars
Seven Stars

Re: Double conditions tFilterRow

Hello,

 

Could you please share your job to have idea about the isse ?

 

Thanks,

Highlighted
Sixteen Stars
Sixteen Stars

Re: Double conditions tFilterRow

Just select "OR" as the logical operator (as both conditions cannot be satisfied at the same time):

Capture.PNG

Hope this helps.


TRF
Highlighted
Seven Stars
Seven Stars

Re: Double conditions tFilterRow

What is the issue ?  did you check if you put 'AND' or 'OR' option in your filter row.

 

Because in the case of 'AND' you will not have any result.

 

Med,

Highlighted
Seven Stars
Seven Stars

Re: Double conditions tFilterRow

 

So first in the value Field you should put only the value not "Frequence =1000".

and in the input column you should specify the column that you want to apply your filter.

 

Like input column = Frequence  and value 1000 ( in case of int variable else you put "1000");

 

Med,

Highlighted
Six Stars

Re: Double conditions tFilterRow

Hello,

 

To copy a file, I want to check if their are on the colonne0 "Fréquence=1000Hz" and "Temps=50

µs" not OR.

If I choose OR I will copy Files with "Fréquence=1000Hz" and "Temps=60

µs" or files with "Fréquence=5000Hz" and "Temps=50

µs"

 

I look other messages

 

Best regards

BastienM

 

Highlighted
Sixteen Stars
Sixteen Stars

Re: Double conditions tFilterRow

Keep a logical test with "OR" and change the condition before tFileCopy to:

((Integer)globalMap.get("tFilterRow_1_NB_LINE_OK")) == 2

The condition will be satisfied only for file where both records exist ("Fréquence=1000Hz" AND "Temps=50µs")

 


TRF

View solution in original post

Highlighted
Seven Stars
Seven Stars

Re: Double conditions tFilterRow

In this case you put in the column input "column0" in your both filters and add the conditions.

 

Please test it.

 

if you stil have error plus share the metadata of your file.

 

Thanks,

Med

Highlighted
Six Stars

Re: Double conditions tFilterRow

It's fine, thank you.

 

Best regards

BastienM

2019 GARTNER 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

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog