Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Guys,
i need to check multiple conditions before doing the data mapping
my scenario i have a exce file as given below
this is how my input file looks like i need to convert this excel file as csv .through dataMapping.
First lookup:In my input file Reason_1 column i need to check where ever Reactive Maintenance,Vandalism/ Graffiti,Accident,Driver abuse is coming while mapping i need to change that as ACR in my output file.
second lookup: need to check two columns Reason_1 should be Scheduled Maintenance and Componentry Type should be Maintenance then output folder my Reason_1 should be MMR like this how can i achieve it
my output file should be like
kinldy help me to sort this.
Regards,
Abisha
Hi,
Please try below code snippet.
!Relational.ISNULL(row1.componenttype) && row1.componenttype.equalsIgnoreCase("Maintenance")?row2.lookup :"ACR"
where the tMap join is as shown below.
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 🙂
Hi Abisha,
The most easy to do it is by tMap. For getting the code value, use a Left Outer join lookup and it will give the data.
For converting the value based on condition of both columns, you can send both input values to the target output column and use condition check for converting them to target column.
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 🙂
hi if possible can you send some screenshot and help me,
since I am unable to pick up what are you telling it wil be helful
this is my Tmap what changes I should do ?
Hi,
Since you are having only one entry for Scheduled Maintenance, it should automatically get the correct value.
What is the output you are currently getting?
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 🙂
Hi ,
I just sent you sample there will be many rows like this and I am getting the following output
if my componentry_type is maintenance and Reason_1 is Scheduled Maintenance then I should get MMR
but in this case whatever is there in Componentry_type its considering only scheduled maintenance.
the above mapping which I have shared is giving me this output.
Hi,
Please try below code snippet.
!Relational.ISNULL(row1.componenttype) && row1.componenttype.equalsIgnoreCase("Maintenance")?row2.lookup :"ACR"
where the tMap join is as shown below.
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 🙂
hey wow its working yar..much appreciated