Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a table having columns
id|f_name|l_name|email_id
1|abc|xyz|null
2|def|mno|null
3|abc|xyz|null
I want to process this table and generate email address for each employees.
If 2 employees have same f_name and l_name then the email address should be like
abc.a.xyz@gmail.com
abc.b.xyz@gmail.com
So, any one can help how could i perform this in talend.
Hi,
I believe you are looking for below solution.
The first subjob's role is to find the unique name combinations and find the count for each combination. It will be stored to a tHashOutput.
The second subjob will sort the data based on name and will do a lookup with unique name count. If the count is more than 1, it will add additional logic to add character else it will be a combination of first name and last name.
The rule which converts the sequence of number to corresponding alphabet is as shown below.
row4.unique_count==1? row5.f_name+"."+row5.l_name+"@gmail.com" :row5.f_name+"."+String.valueOf((char)(Numeric.sequence(row4.full_name,1,1) + 96))+"."+row5.l_name+"@gmail.com"
The sequence is named after full name. So for each full name combination, the sequence will get automatically reset.
I hope I have answered your query. Please add additional checks to make sure that first name and last name columns are not null. Could you please spare a second to mark the topic as resolved? Kudos will be a bonus from your end 🙂
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved