Hello @Jamshed Salik ,
Thanks for the question and using MS Q&A platform.
From your error - it looks like there are null values in your field - ''
- null string - is encountering the error while converting to float.
You could try the @Nandan Hegde approach - if my understanding is correct he has not mentioned explicitly the type as float
to perform the copy activity. If this is not working for you, we will have to make use of the Mapping Data flow.
Because copy activity in Azure data factory only allow us to perform data movement as is. Handling type conversion from string to float directly is not available in copy activity. To do any kind of check or transformation we should consider data flows.
You can consider derived column transformation for your case to check if value is empty or not and type cast using the toFloat function. For all other strings, you can set it as a zero or any value as per your requirement
iif(isFloat(Field1),toFloat(Field1),0)
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators