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

  • Data Integration
1 ACCEPTED SOLUTION

Accepted Solutions
Nine Stars TRF
Nine 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
8 REPLIES
Six Stars med
Six Stars

Re: Double conditions tFilterRow

Hello,

 

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

 

Thanks,

Nine Stars TRF
Nine 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
Six Stars med
Six 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,

Six Stars med
Six 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,

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

 

Nine Stars TRF
Nine 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
Six Stars med
Six 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

Six Stars

Re: Double conditions tFilterRow

It's fine, thank you.

 

Best regards

BastienM