tMap with "LIKE" operator

One Star

tMap with "LIKE" operator

Hello!
I have the following issue:
normally a join in a tMap - component works that way:
"luZWHashKey.KURZBEZ = mainrow.khnr;"
but what i would need now is some kind of "LIKE" parameter, for example:
mainrow.khnr.startsWith(luZWHashKey.KURZBEZ), so no exact match is needed.
Is this possible using a tMap?
Thanks in advance,
Stefan

Re: tMap with "LIKE" operator

Yes, you can get that functionality from a tMap.
In the tMap, in the lookup table turn on the expression filter.
put your condition in there. Then do the join in the normal way.
One Star

Re: tMap with "LIKE" operator

Hello!
Thank you for the answer, but I hope it would be that easy.
The join should work if the main rows BEGINS with any value from the lookup row.
For example:
The main row has a value "ZVKsometext" and on value of the lookup (a database table) is "ZVK", the two should "match".
Any ideas?
Employee

Re: tMap with "LIKE" operator

Don't set a key column in your lookup and set in your lookup filter the following expression:
main.myColumn1.startsWith(lookup.myColumn2)

I hope it will work.
One Star

Re: tMap with "LIKE" operator

I would like to do a multi-way join with several database tables and have the resulting rows be an input to a tMap so that I can map the columns from these rows to an output schema. Can I simply associate a single query to a db input component? If so, how?

Re: tMap with "LIKE" operator

Yes, Each database input component has a place to enter a query. Then you need to edit the schema to match the output of your query.
Two Stars

Re: tMap with "LIKE" operator

hi all,
my input row has data like abc xxxx def ghi and lkp data have def ghi  def xxxx xyz like how to lkp the flow?
thanks and regards
feroz syed
Four Stars

Re: tMap with "LIKE" operator

Hi Feroz,
Your above description is not clear, but still 
Input data main
abc xxxx def ghi
Input data lookup lkp
def ghi  def xxxx xyz

YOu need lkp output, then use tMap, Inner join on def and ghi and get lkp columns in output

Refer to tMap documentation for more details.

Thanks
vaibhav
One Star

Re: tMap with "LIKE" operator

Hello,
I have a issue in mapping the columns in tMap
i want to execute the like condition show below,
a.column like 'abc%'; based on this condition i update or insert the data in the table.
example:
i have a table ABC:
ID |column1 | column 2 | column3 | column4 |.........
1  |name1    | abc001
2  |name2    | xyz001
3  |name2    | pqr002
i have a condition here if 
column2 like 'abc%'   true i will update the row 
column2 like 'lmn%'  false i will insert new row
how can i achieve these kind of condition using tMap ?
Thanks,
Ashwath.
Twelve Stars

Re: tMap with "LIKE" operator

split flow into 2 with tMap by filters
filter for 1 - length(col) >= 3 and (left(col,3)).equals("abc")
filter for 2 - length(col) >=3 and (left(col,3)).equals("lmn")
flow 1 send to INSERT, flow 2 send to UPDATE
this is only example of logic, because You also can decide - what todo with other records? You can make double filter and send both to INSERT/UPDATE 
-----------