How can we do decimal validation in Ataccama one web DQ rules.
ย
input attribute data type should be float for this rule.
ย
ย
How can we do decimal validation in Ataccama one web DQ rules.
ย
input attribute data type should be float for this rule.
ย
ย
Best answer by MayKwok
I tested this on my test data set (postgres db source), so Iโll be very interested to see if it works for you.
ย
Letโs say my rule attribute is value1 (float) type.
ย
For my rule condition Iโve put, in Advanced Expression form:
indexOf(toString(value1),โ.โ) is null
ย
This casts the value1 to string, then check if it contains a decimal point. If it doesnโt contain it, then the expression evaluates to โtrueโ.
ย
In Ataccama ONE DQ rules, the default mode is that if condition is met, then record is INVALID, else VALID. So the above expression will flag any records that doesnโt contain the decimal point, as INVALID.
ย
You may wish to extend the expression to this to also cater for if the database stores the decimal as a comma, like so:
indexOf(toString(value1),โ.โ) is null or indexOf(toString(value1),โ,โ) is null
ย
Please give it a try and let us know how it goes! Hope this helped?
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.