Page 1 of 1

Data Quality - Issue with functions in the data rule logic

Posted: Tue Jan 03, 2017 9:56 am
by k.prashanthi
Hello,

I am working on a data rule logic in the Information Analyzer to pull the remainder from a decimal value.
I tried functions like Mod,FLOOR, Ceil but it's throwing errors saying they are not known scalar functions. I also tried using right function, this one worked but I can not bind the variable as it's converting the type to string based on the string function I used.

column_name_FLOOR(column_name)
right(column_name,2)

I went through the below forum chain and tried using Val() function but still I am having the binding issue.

http://dsxchange.com/viewtopic.php?t=156215

val(right(column_name,2))

can someone please help me fix this. TIA.

Posted: Tue Jan 03, 2017 2:01 pm
by qt_ky
There is a version 11.5 technote about the val function that may be of interest. It says to apply rollup patch 5 for the fix.

If this describes your issue, then you may need to contact Support and request a patch for your version.

JR56745: val() returning incorrect results

http://www-01.ibm.com/support/docview.w ... wg1JR56745

Posted: Tue Jan 03, 2017 6:01 pm
by JRodriguez
What's a remainder? For a division's remainder use the module function (%) directly.

If you meant the fractional part of a decimal value that could be extracted using trunc() or round() functions as shown below

DecimalValue - trunc (DecimalValue, 0)
DecimalValue - round(DecimalValue, 0)

123.45 - trunc(123.45, 0)
123.45 - 123.00 = 0.45

****same result with Round()

Regards