Talend Connect
Virtual Summit
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

Highlighted
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  col5ABHS-SMH-4OZ-01            EA               CS             12     1ABHK-SMH-01                EA               CS             24      1Expected data after transformation :Col1                        COL2               COL3       COL4 col5 ABHS-SMH-4OZ-12            EA                   CS       12     1ABHK-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.
Highlighted
Moderator

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

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

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.
Highlighted
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.
Highlighted
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 !
Highlighted
Moderator

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

Hi,
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.
Highlighted
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.
Highlighted
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.

## OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

## Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now