Five Stars

How DO I APPLY DATA transformation using talend tmap component.

Hi ,
Greetings,
We have retail industry data . In that ,we  need to convert  each Unit SKU'S TO CASE   SKU'S BY using conversion factor(that is column 4)
Input data 
We have input data for 
Col1                        COL2               COL3       COL4  col5
ABHS-SMH-4OZ-01            EA               CS             12     1
ABHK-SMH-01                EA               CS             24      1

Expected data after transformation :
Col1                        COL2               COL3       COL4 col5 
ABHS-SMH-4OZ-12            EA               CS       12     1
ABHK-SMH-24                EA               CS       24     1


We are trying to write the transformation/conditional logic  in tmap output schema. is there  way to write such  conversion  of  Data in the form of expression in tmap.
Thanks In advance.
6 REPLIES
Moderator

Re: How DO I APPLY DATA transformation using talend tmap component.

Hi,
We have input data for 
Col1                        COL2               COL3       COL4  col5
ABHS-SMH-4OZ-01            EA               CS       12     1
ABHK-SMH-01                   EA               CS       24      1

Expected data after transformation :
Col1                        COL2               COL3       COL4 col5 
ABHS-SMH-4OZ-12            EA               CS       12     1
ABHK-SMH-24                   EA               CS       24     1

You want to merge Col1 and COL4? Could you please give me more description about this logic?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How DO I APPLY DATA transformation using talend tmap component.

Hello Sabrina,
Description of Logic :
We have to convert unit Stock keeping unit into Cases  stock  keeping unit.
Pattern of Unit Sku's represented by :  -01 in the end that is  ABHS-SMH-4OZ-01
Pattern of Cases SKU'S is representation of : -24 in the end of string  that is  ABHS-SMH-4OZ-24
we have conversion factor  column (col4)  : that is based on packaging it could be 12,24  so we would like to use this column for  transformation in col1.
Sort of merge only : Let's say whenever it looks for -01 on the basis of col4. it replace by -12 or -24 at the end of string in col1.
and also we can use col3 column it  means CS means Stock Unit  of measurment . that is code  for Identifying Cases.
also col2 =EA meanse eaches that means Stock Unit of Measurement code for  Identifying unit sku's .
for ex: looking for something like  case when then code type expression with the help of given column . but not sure how do i obtain column one  which appends -12,-24,16 based on the value in col4. 
Five Stars

Re: How DO I APPLY DATA transformation using talend tmap component.

Hello Sabrina,
I tried following Regex  so far in java.:
"ABHS-SMH-4OZ-01".matches(".-01.");
first i want to match on the column  then i am trying to replace my match with col4 that is -12 -,24.
Please  give me guidance  hw to do in talend  tmap expression.
We tried following regex so far:
I want to search for something 
e.g. "ABHS-SMH-4OZ-01"
search for "-01"
return "ABHS-SMH-4OZ-24"
This is my regex so far"ABHS-SMH-4OZ-01".matches(".-01.");

Any help on it would be much appreciated !
Moderator

Re: How DO I APPLY DATA transformation using talend tmap component.

Hi,
For your job requirement, we made a demo job for you.
Could you please take a look at my screenshots for details?
Let us know if it is Ok with you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Five Stars

Re: How DO I APPLY DATA transformation using talend tmap component.

Thanks a ton !  sabrina for demo instructions.

We want to use this substring function in tmap mapping.
Moderator

Re: How DO I APPLY DATA transformation using talend tmap component.

Hi,
Feel free to let us know if it is Ok with you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.