rounding data issue
Archana, The precision is defined as 2 in the Select Values step metdata tab. Due this, the values are rounded off to 2 decimal places.
yes i want them to round off by 2 decimals but again sum of colval2 + value4 should be equal to 6 as per rules. it is failing even if it doesnt match the decimal count.
If the aggregated value (Val2+val4) is rounded and then compared against sum of individually rounded values (Val2 and Val4) - This may not necessarily match absolutely as the rounding policy is different and precision is lost during rounding.
Consider computing Val6 after Val2 and Val4 is rounded to 2 decimals, or consider higher precision.
If you still need more control over your numbers, how about trying a "calculator" step at the end of your process to round the numbers for you?
From 8.x PDI have the option of "ROUND_CUSTOM" and in your case I would bet on somthings like:
B - Constant value 3 - ( for 3 digits)
C - Constant value 3 - (For decimal Floor)
ROUND_CUSTOM(A,B,C) - YourValue,B,C
You can also play with the mask.
Rounds B using a specific type of rounding mode indicated by C (see list). Calculates using the same conditions as the ROUND_CUSTOM( A , B ) function with the following exceptions:
i am still using pentaho 5 version. what would be the alternative
If you dont find any other option... you could split the number, floor the decimal, and put then together again.
Retrieving data ...