Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to make a lookup based on a multi condition.
I generate people and I want to get the Age Category Label with this lookup condition
AgeMin<=People.Age AND People.Age<AgeMax
What are the differents ways please?
Yours Faithfully
DAURIAC Igor
Hi,
The neat an easy way to do is to add the condition in expression section of output tmap.
If you are happy with the solution, could you please mark the topic as resolved? Kudos are also welcome 🙂
Warm Regards,
Nikhil Thampi
Hi Nikhil,
If I wanted to apply two completely separate conditions, how would I do it? When I do,
StringHandling.LEFT(row3.ResponseContent,StringHandling.INDEX(row3.ResponseContent,":")); row3.ResponseContent.replaceAll("\"","")
it doesn't work.
I could see that you are doing data assignment in the tMap condition check. You do not have to assign the values at the condition check area. Any data assignment (with or without column level condition) need to happen within the column level mapping.
Now, if you have to verify two conditions at same time, you can use operators like AND or OR symbols like I had mentioned in my previous post.
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
Thanks, Nikhil. I'm actually putting these two conditions at the column level mapping and have tried both AND and OR but it doesn't work. (screenshot attached).
I have a workaround where I use "StringHandling.LEFT(row3.ResponseContent,StringHandling.INDEX(row3.ResponseContent,":"))" in tMap and then use tReplace for "row3.ResponseContent.replaceAll("\"","")"
Instead of having multiple components (tMap and tReplace), I was wondering if these two conditions could be applied in one.
Could you please try below logic?
StringHandling.LEFT(row3.ResponseContent,StringHandling.INDEX(row3.ResponseContent,":")).replaceAll("\"","")
Please note that if you do not have any ":" in the input string, the job will fail with Index error. In that case, you will have to add additional rules to avoid the error.
If the answer has helped you, please mark the topic as resolved.
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
Worked. Thanks! Point noted about the ":".