I have a rule that says A must be B*(1-C).
Problem is A is coming from a table, a decimal(21,3) field.
But the calculation is coded in the rule and has no rounding. So I'm getting rule violations of 0.633 versus 0.633012.
So I need to round the calculation to 3 decimal places.
I found documentation that says it is ROUND. But it is for v9.x or later. I also tried FIX, no luck.
Someone out there must know?
Thanks in advance.
What is IA's ROUND function?
What is IA's ROUND function?
Last edited by truenorth on Tue Feb 09, 2016 5:19 pm, edited 1 time in total.
Todd Ramirez
Sr Consultant, Data Quality
San Antonio TX
Sr Consultant, Data Quality
San Antonio TX
Re: What is IA's ROUND function?
Just as a guess, could you use REGEX? The IA 8.7 guide suggests that "You can use a expression that can be made up of scalar functions, arithmetic operations and variables as a source data. If you use this expression, make sure that the expression evaluates to a character or string data type."
Or could you upgrade your IA version?
Or could you upgrade your IA version?
Choose a job you love, and you will never have to work a day in your life. - Confucius
I don't think REGEX would do the job, because I still need to test the equality between the two values.
However, I came up with a solution:
tostring(A, '%f24.2') = tostring(B * (1 - C), '%f24.2')
Why .2? I decided to loosen the rule because the calculation and the resulting rounding might do funny things so that too many records might violate the rule. Two decimal places of precision softens the rule. A few exceptions may still slip thru - like 1.399 being rounded to 1.4 - but we can live with a few rather than many thousands of exceptions that business would not care much about.
However, I came up with a solution:
tostring(A, '%f24.2') = tostring(B * (1 - C), '%f24.2')
Why .2? I decided to loosen the rule because the calculation and the resulting rounding might do funny things so that too many records might violate the rule. Two decimal places of precision softens the rule. A few exceptions may still slip thru - like 1.399 being rounded to 1.4 - but we can live with a few rather than many thousands of exceptions that business would not care much about.
Todd Ramirez
Sr Consultant, Data Quality
San Antonio TX
Sr Consultant, Data Quality
San Antonio TX