Decimal Precision Error


(Kalicharan Khetwal) #1

Hi,

I want to set the float data precision to 2 digits. I tried with the below expression:

math.round(src_column,2) but its throwing below error. Could you please look into it?

ERROR: The expression result type FLOAT must be convertible to expected type BOOLEAN.

Thanks
kc


(Danny Ryan) #2

Hi kc,

It sounds like the expression you are entering is against a column that has the data type of Boolean.

Are you able to post an image or example?

Thanks
Danny


(Kalicharan Khetwal) #3

image

image


(Kalicharan Khetwal) #4

My source column is type FLOAT, while debugging it returns correct, but surprisingly writing the expression is incorrect.
FYI, I’m writing the expression in Profiler’s Business rule tab.


#5

Business Rule expects to receive boolean result ‘True’ or ‘False’.

So you should rewrite your expression to return a boolean result. Something like the following:

math.round(ANP, 2) = ANP

(Kalicharan Khetwal) #6

Hey Alex,
Thanks a lot for resolution. In addition to it could you please let me know how can I remove the time portion from datetime field ? I just need to convert datetime to date.
ex: dd-MM-yyyy HH:MM:SS to dd-MM-yyyy.
Note: This has to be done in setting up business rule within Profiler.

Thanks again.


#7

You can use toDate function


(Kalicharan Khetwal) #8

Hey Alex,

could you share an example because toDate() is not working for me?
I tried to debug the expression to, every time Null value is coming as output.