You are not logged in.
Announcement
Unanswered posts
|
Pages: 1

Hi all
In the source table in databse,the type of column 'USA_USDUnitPrice' is decimal. When output in talend, it was bigdecimal. But I want to insert one row which 'USA_USDUnitPrice' values 0,and we get a error,can't convert bigdecimal to int. So i transfer it as Object type.,it works fine.
However,in tAggregateRow,when i sum 'UnitPrice',I get the warning :
'Warning:the operation 'sum' for the output column 'USA_USDUnitPrice' can't be processed because of incompatible input and/or output types'.
I think that it couldn't be sumed with the data type object,how can i solve this issue by a easy method.
Thank you for any suggestion.
Best Regards
Joe
Offline
Hi Joe
Can you upload some screenshots of job?
Best regards
Shong
Offline
Hi Joe
Yes, just do it. Export the job and send it to me.
Best regards
Shong
Offline
Hi Joe
I did't receive any email from you, which email have you sent to? Please try again.
Best regards
Shong
Offline
Hi Joe
Yes, you are right. it couldn't be sumed with the data type object!
But I want to insert one row which 'USA_USDUnitPrice' values 0,
Sorry, I don't understand why you want to insert value 0 but doing 'sum' operation on this column?
Best regards
Shong
Offline

Hi Shong
There are three tmaps,'USA','CAN',and 'USB',and three related column,'USA_USDUnitPrice','CAN_UnitPrice','USB_UnitPrice'.
For example,in tMap 'USA',we get the value of 'USA_USDUnitPrice',and set the other two as 0.00;in tMap 'CAN',we get the value of 'CAN_USDUnitPrice' and
set 'USA'AND 'CAN' as 0.00.
At last ,we union these three all,and sum .
Best Regards,
Joe
Offline
Hi
Set a default value for bigDecimal type as below:
new java.math.BigDecimal(0)
union these three all and sum them on tAggregateRow, select 'bigDecimal' type on output table.
Best regards
Shong
Offline

Hi Shong
it works. but i get a new problem. According to the requirement,I have to sum 'USA_USDUnitPrice' twice,and value to two defferent fileds,and here comes the error
'Duplicate field AggOperationStruct_tAggregateRow_1.SUA_USDUnitPrice_sum'
how can i solve this ?
Thank you very much
Best Regards,
Joe
Offline
Hi
Where do you sum 'USA_USDUnitPrice' twice? Can you upload a screenshot?
Best regards
Shong
Offline

Hi
in the tAggregateRow, I will sum the field 'USA_USDUnitPrice' twice.
output Function input
USA_USDUnitPrice sum USA_USDUnitPrice
CAN_USDUnitPrice sum CAN_USDUnitPrice
USA_USDUnitPrice sum USB_USDUnitPrice
like this. and i will get the error. I just don't want to use another tMap to value for USB_USDUnitPrice. Each processing in tmap,it will take a lot of time.
Best Regards,
Joe
Offline
Pages: 1