skip to Main Content

I have been trying to do a datatype check in a decimal column of a file by using the Data Flow from Azure Data Factory, but it is not working as expected. My issue is the following one:

I want to check if the number 121012132.12 is a decimal, so I am using the data flow’s derived column and writing the expression: isDecimal(‘121012132.12’, ‘17.2’). The output has always been false, even if I change the precision or replace a dot with a comma, etc. I have tried many different ways, but without success. I realized that if I shorten the number, it recognizes it as decimal. Moreover, If I try to convert it into decimal, it works well (toDecimal(‘121012132.12’, 17, 2)

Please, can anyone tell me if there is a different way to do this check?

Thank you in advance

2

Answers


  1. This happens because for decimal the precision is defaulted to (10,2).

    try isFloat(‘121012132.12’) this will work

    Thanks
    Hijesh

    Login or Signup to reply.
    1. In azure data type check does not work as we expect

    2. isFloat(100) = true

    3. isFloat(100.1) -> true

    4. isDecimal(100) -> true

    5. isDecimal(100.1) -> true

      Try below

    iif(length(coalesce(split(VALUE,'.')[2],''))>1, true(), false())

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search