Floor Casting

Hi Experts,
I have to write the below floor function in reformat.
The source column data type is string as shown {utf8 string("x01") lcl_prod_cd}, here column name is "lcl_Prod_cd ". now i have to apply the floor function on this like "Floor(dp.lcl_Prod_cd/10)". i was tried in different ways like i was changed target dml to decimal and tried as shown below. it is throwing error
out.lcl_prod_cd::decimal(10) floor(in.lcl_prod_cd/10);
simallarly tried with integer also.
could you please suggest me how to resolve this?

Showing Answers 1 - 2 of 2 Answers

  • Jul 4th, 2018

Hi Maheswari,
Can you please post the exact error. If it is type casting problem means you should convert input string value to decimal and then to integer, then it will work.
Let me know if am wrong.

  Was this answer useful?  Yes


  • Oct 31st, 2019

try using this:
out.lcl_prod_cd:: floor(decimal(10)in.lcl_prod_cd/10);

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions