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 in Talend by Palanisamy
207 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

Let me know if it solves your issue.

answered Aug 5 by Vardhan
• 12,820 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,450 points
1,538 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,430 points
873 views
0 votes
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 443 views
0 votes
2 answers
0 votes
1 answer

Looping through all the schemas in Talend

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

answered Apr 10, 2018 in Talend by code.reaper12
• 3,450 points
134 views
0 votes
1 answer

Parsing JSON in Talend

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

answered Apr 2, 2018 in Talend by code.reaper12
• 3,450 points
581 views
0 votes
1 answer