Rounding Errors for Decimal values in KNIME

I’m surfacing amount column based on DEBIT and CREDIT from my DataSource to KNIME. SO, when I query the data using DB reader the amounts are not matching with the amounts in CDP (after decimals) like when i do summation on total amount I’m getting the sum 0 but when I do group on DEBIT and CREDIT I’m getting minor differences in values. But DEBIT and CREDIT values should be equal. we believe it’s because of rounding errors in KNIME. We have tried by using Round nodes but no help. Can anyone help me how to get exact values from DataSource to KNIME?

1 Like

KNIME does not have a currency or fixed decimal data type, which unfortunately makes it less business friendly for new users… You may need to round calculations at multiple points along the workflow to avoid compounding issues. I round by default after every grouped calculation, and regularly directly in calculation formulas.

You can use the Round Double node for this, or include it directly in Column Expressions node calcs using - round(column(“name”),2)

Round double can be configured and copied / pasted for easier duplication. I would recommend avoiding group calcs for early workflow steps like matching up transactions. Stick with a formula approach and save the group calcs and pivots for later presentation adjustments whenever possible.


I would definitely put a currency friendly data type toward the top of the development list to target small business users for wider platform adoption.


I am facing a similar problem where the way Java treats decimal -according to this post - is creating the issues.

The result is that once I start rounding and summing in the billions range in my BIRT Report. I will have minor difference which are not accepted by my internal stakeholders.

@iCFO - do you have any suggestions?

I do my calculations in KNIME and then pass the pre-processed report tables and info over via a large number of Send to Report nodes. I know that is a major change that requires a lot of adjustments. Sorry, I don’t have any magic bullets on the BIRT side…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.