In Talend how to specify multiple conditions as expression

0 votes
hi,

I'm working on talend7.2. I am creating a map using Tmap. I need to specify the following expression JOIN and condition.

((ITM_MAS_SUMMARY_ROW.ITMRATE>=SALES_RANGES_DIM_ROW.FROMRATE) && (ITM_MAS_SUMMARY_ROW.ITMRATE<=SALES_RANGES_DIM_ROW.TORATE)) && (ITM_MAS_SUMMARY_ROW.PRDCODE==SALES_RANGES_DIM_ROW.PRDCODE) .

But when i run the job, it throws an error message. (The message shows error at >=).

Please help me solve this situation.
Jul 31, 2019 in Talend by Palanisamy
6,310 views
Hi Palani, can you please share the screenshot of the error?? That will be really helpful.
What is the data type of the fields that you are comparing?
ITMRATE is Number (Bigdecimal in Talend)

FROMRATE & TORATE  are Number (Both are Bigdecimal in Talend)

and PRDCODE is string.
Try using .compareTo() function instead of direct comparison like below.
ITM_MAS_SUMMARY_ROW.ITMRATE.compareTo(SALES_RANGES_DIM_ROW.FROMRATE) [ > / < /  == ] [Value]

Here value is 0 if Equal,

value = 1, if fromrate > itmrate else -1.
Hi there.

The compareTo is not working for me. Can anyone suggest me another way of solving this.

((ITM_MAS_SUMMARY_ROW.ITMRATE>=SALES_RANGES_DIM_ROW.FROMRATE) && (ITM_MAS_SUMMARY_ROW.ITMRATE<=SALES_RANGES_DIM_ROW.TORATE)) && (ITM_MAS_SUMMARY_ROW.PRDCODE==SALES_RANGES_DIM_ROW.PRDCODE) .
Here the ITMRATE shoule be BETWEEN FROMRATE and TORATE.

Thanks in advance.

1 answer to this question.

0 votes

@Palaniswamy, have a look at this discussion from Talend Community: https://community.talend.com/t5/Design-and-Development/resolved-Join-two-table-with-condition/td-p/72647

Hope this will help!

Join the Talend course today to know more about and become expert.

Thanks.

answered Aug 5, 2019 by Vardhan
• 13,190 points

Related Questions In Talend

0 votes
1 answer

How to generate multiple rows from a single row in Talend?

I think using tJavaFlex, tMap and tFlowToIterate ...READ MORE

answered Apr 18, 2018 in Talend by code.reaper12
• 3,500 points
7,252 views
0 votes
1 answer

Using tHiveRow to execute multiple Hive queries in Talend

In order to execute multiple queries, you ...READ MORE

answered Apr 14, 2018 in Talend by misc.edu04
• 1,450 points
3,518 views
+1 vote
1 answer
0 votes
2 answers

How to use java classes in Talend?

For many data integration requirements, the standard ...READ MORE

answered Oct 3, 2018 in Talend by daisyridley
• 160 points

edited Oct 3, 2018 by Vardhan 2,849 views
0 votes
1 answer

How to loading flat file from configuration in Talend?

Hey, @There, Regarding your query you need to ...READ MORE

answered Jun 4, 2020 in Talend by Gitika
• 65,910 points
1,756 views
0 votes
1 answer

Looping through all the schemas in Talend

It is really simple to make tOracleInput ...READ MORE

answered Apr 11, 2018 in Talend by code.reaper12
• 3,500 points
1,492 views
0 votes
1 answer

Parsing JSON in Talend

While working with JSON files, one thing ...READ MORE

answered Apr 3, 2018 in Talend by code.reaper12
• 3,500 points
3,577 views
+1 vote
1 answer
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP