tMap how to check that column field is equal to "ABC" or not

One Star

tMap how to check that column field is equal to "ABC" or not

I have a csv file and it has 4 columns
on the first column there is Referrer Type.
I want to create two csv file that matches Referrer Type equals to "typed/bookmarked" or not.
On the expression builder i wrote row1.ReferrerType.contains"typed/bookmarked")?"Search":"Non Search" ( i could't find better expression that works)
If i put tFileInputDelimited --> tMap --> TlogRow i see filtered output but i want to create a csv
tFileInputDelimited --> tMap --> tFileOutputDelimited brings me only the header it is empty
Best Regards
Cihan
Five Stars

Re: tMap how to check that column field is equal to "ABC" or not

tFileInputDelimited --> tMap--tLogRow.
if you don`t have any row in tlogrow that means tmap is not filtering any record so even after tJavarow you can place tFileOutputDelemeted directly.
One Star

Re: tMap how to check that column field is equal to "ABC" or not

tmap ---> i see the filtered output but when ? do
tFileInputDelimited --> tMap --> TlogRow --> tFileOutputDelimited
The file is empty only the header
What do ? need to do to write the filtered output to a csv file
Five Stars

Re: tMap how to check that column field is equal to "ABC" or not

can you show the screen shot of tFileOutputDelimited component and remove tLogRow anyway it is just show whether any records is being passing through or not.
Five Stars

Re: tMap how to check that column field is equal to "ABC" or not

In your original post, you say: -
"On the expression builder i wrote row1.ReferrerType.contains"typed/bookmarked")?"Search":"Non Search" ( i could't find better expression that works)"
There is a syntax error here; but hopefully, your Job is correct.
This is just looks like a mapping expression. It only alters the data and does nothing to the number of rows that are output. It should make no difference whether you're outputting to a tLogRow or tOutputFileDelimited.
Do you have a filtering expression and, if so, what is it?
One Star

Re: tMap how to check that column field is equal to "ABC" or not

You are right
row1.ReferrerType.contains"typed/bookmarked")?"Search":"Non Search is mapping expression and only alters the data.
I am trying to write filtering expression like
row1.ReferrerType.equals("typed/bookmarked")
row1.ReferrerType==("typed/bookmarked")
row1.ReferrerType.value==("typed/bookmarked")
They are boolean and returns true or false but what will i do after this;
I have to say ;
if it is false write to csv1
if it is true write to csv2
Regards
Five Stars

Re: tMap how to check that column field is equal to "ABC" or not

With tMap, you can have multiple outputs. Each output can have an expression filter. Within this expression filter, you can make your true/false comparisons.
One Star

Re: tMap how to check that column field is equal to "ABC" or not

I did like this
tMap expression is ((row1.Url.contains("psrcval=1"))&&(row1.ReferrerType.contains("typed/bookmarked"))?"Paid":"Non Paid")
because ? can't make true/false comparisons anyway;
then I added tFilterRow URL MATCH EQUALS "Paid"
then I added two tFileOutputDelimited files
connected TFilterRow -- filter --- tFileOutputDelimited
TFilterRow-- reject -- tFileOutputDelimited
Maybe there more easy ways to do it but boolean expressions return true or false and needs to checked somewhere.