Hello Community
I am trying to write a DQ rule using a regular expression, I have been using the “ONE Expressions” documentation to help with this but I can’t seem to get it working. Can anyone advise where I am going wrong please??
Example
Input data:
Value1 | Value2 | Value3 |
---|---|---|
-1137.86 | -5689.33 | 0.2 |
DQ rule I am trying to achieve:
- Value2 * Value 3 = -1137.866
- Take only the first 2 decimals of the above bullet WITHOUT rounding = -1137.86
- Check if value1 equals the value in the bullet above. (i.e. -1137.86 = -1137.86 so it should show as a valid result)
How I have written this in Ataccama using a regular expression:
- Value1 is NOT (substituteAll("(\d+\.\d{2})(\d+)","${1}",toString(Value2 * Value3)))
- Then result is INVALID
Error I get:
- Using the test rule feature with the example input data above, it says that the result is INVALID when I am expecting it to be VALID.
- And only if I change Value1 to equal -1137.866 then it will show VALID which is not what I want to achieve.
Can anyone see where I am going wrong please? Thanks!