Hey, Guys!
I have a problem to do a validation on CNPJ. This error is happened when I used the code.
The recurrent problem is on photo, but when I repair at line the same problem appear at other line
Above my code:
substring($column1$, 0, 2) + “.” +
substring($column1$, 2, 3) + “.” +
substring($column1$, 5, 3) + “/” +
substring($column1$, 8, 4) + “-” +
substring($column1$, 12, 2) as CNPJ,
(
(
(
(
(toInt(substring($column1$, 0, 1)) * 5) +
(toInt(substring($column1$, 1, 1)) * 4) +
(toInt(substring($column1$, 2, 1)) * 3) +
(toInt(substring($column1$, 3, 1)) * 2) +
(toInt(substring($column1$, 4, 1)) * 9) +
(toInt(substring($column1$, 5, 1)) * 8) +
(toInt(substring($column1$, 6, 1)) * 7) +
(toInt(substring($column1$, 7, 1)) * 6) +
(toInt(substring($column1$, 8, 1)) * 5) +
(toInt(substring($column1$, 9, 1)) * 4) +
(toInt(substring($column1$, 10, 1)) * 3) +
(toInt(substring($column1$, 11, 1)) * 2)
) % 11
) < 2 AND toInt(substring($column1$, 12, 1)) == 0
) OR (
(
(
(toInt(substring($column1$, 0, 1)) * 5) +
(toInt(substring($column1$, 1, 1)) * 4) +
(toInt(substring($column1$, 2, 1)) * 3) +
(toInt(substring($column1$, 3, 1)) * 2) +
(toInt(substring($column1$, 4, 1)) * 9) +
(toInt(substring($column1$, 5, 1)) * 8) +
(toInt(substring($column1$, 6, 1)) * 7) +
(toInt(substring($column1$, 7, 1)) * 6) +
(toInt(substring($column1$, 8, 1)) * 5) +
(toInt(substring($column1$, 9, 1)) * 4) +
(toInt(substring($column1$, 10, 1)) * 3) +
(toInt(substring($column1$, 11, 1)) * 2)
) % 11
) == (11 - toInt(substring($column1$, 12, 1)))
)
) as Valid_CNPJ