Hello
Can someone help me please?
I have some data in 4 columns that I need to perform some calculations on.
ID Col1 Col2 Col3 Col4
1 100 150 8 25
2 200 250 9 35
3 150 175 8 27
What I need to do is this simple ecquation
Col1 + Col2 + (Col3 * Col4)
Is this possible to achieve using tJavaRow? is it easier using an Expression within tMap?
I have tried to do this within tJavaRow creating a variable and assigning the equation to the variable but it doesn't like my '+' and '*'. Can someone tell how to achieve this using Java please?
Thank you
Ricco
Its ok, I have cracked it. I have the following tMap --> tConvertType --> tJavaRow --> tLog tmap created the addition column. tConverType convert column 3 to a bigdecimal tJavaRow dows the calculation and assigns the result to the column i.e output_row.Column5 = input_row.col1.add(input_row.col2.add(input_row.col3.multiply(imput_row.col4))); The result is printed in the tLogRow. Thanks everyone for your inspiration.
Something else I failed to mention. 3 of the columns (1,2 and 4) are all BidDecimals and column 3 is an integer. Can anyone help me calculate based on this criteria? Thanks
Its ok, I have cracked it. I have the following tMap --> tConvertType --> tJavaRow --> tLog tmap created the addition column. tConverType convert column 3 to a bigdecimal tJavaRow dows the calculation and assigns the result to the column i.e output_row.Column5 = input_row.col1.add(input_row.col2.add(input_row.col3.multiply(imput_row.col4))); The result is printed in the tLogRow. Thanks everyone for your inspiration.
Hi ,
Try with below one without tConvertType:
output_row.Column5 = input_row.col1.add(input_row.col2.add((BigDecimal.valueOf(input_row.col3.multiply))(imput_row.col4)));
Regards,
Kumar