You are not logged in.
Announcement
Unanswered posts
|
("notavailable".equals(row1.col1) || "not related".equals(row1.col1) || "na".equals(row1.col1))?new BigDecimal(0):new BigDecimal(row1.col1)
-----------------------------------
See java Doc for BigDecimal :
public BigDecimal(String val)
Translates the string representation of a BigDecimal into a BigDecimal. The string representation consists of ...
tht should not be work,
getting the following issue with above code (janhess code)
any help,other than that....?
BigDecimal(string)
thanking u for ur quick response
,but....
we can load if target as INT or FLOAT (by using above syntax)
......BUT......
actually my target columns datatype's are big decimal!
HOW WE CAN CONVERT THAT INPUT STRING COL1 TO BIGDECIMAL?
thx
In tMap for column1:
("notavailable".equals(row1.col1) || "not related".equals(row1.col1) || "na".equals(row1.col1))?0:Integer.parseInt(row1.col1)
and for column2
"notavailable".equals(row1.col1)?1 : ("not related".equals(row1.col1)?2 : ("na".equals(row1.col1)?3:0)))
Hope it'll help
hi pals,
from excel file i am getting data like tis..
col1(source column)
----
notavailable
not related
na
10
notavailable
30
na
i need to load into target
col1(target column1) , col1-indicator (target column2)
------------------------ ------------------------
0 1
0 2
0 3
10 0
0 1
30 0
0 3
the logic is before loading into target :-
if col1='notavailable' then col1(target column1) as 0 and col1-indicator (target column2) as 1
if col1='not related' then col1(target column1) as 0 and col1-indicator (target column2) as 2
if col1='na' then col1(target column1) as 0 and col1-indicator (target column2) as 3
if col1=10 then col1(target column1) as 10 and col1-indicator (target column2) as 0
the problem is:
there is not consistance in source data!!!
can possible to do the above logic with tMap?,if let me know any one ,how it's?
NOTE: Both target columns are decimal
thx