Changing type from an array item - Data Factory

Gustavo Loli 31 Reputation points
2022-08-26T14:52:21.427+00:00

Hi,

I need to change my data to another format by the azure data factory.
The "feeAmount" is an string, and must be changed to a decimal, but I'm getting an error because it's inside an array.

data:
235210-image.png

error:
235220-image.png

I'm using the Derived Column to make this change. I understood that the problem here is because the object is inside an array.
235246-image.png

Could anyone help me to make this?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,623 questions
0 comments No comments
{count} vote

Accepted answer
  1. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2022-08-29T04:52:47.417+00:00

    Hi @Gustavo Loli ,

    Welcome to Microsoft Q&A platform and thanks for posting your question.

    As I understand your issue, you are trying to convert 'feeAmount' dataType to decimal, but it's throwing error: "toDecimal does not acceptArrayType". Please let me know if my understanding is incorrect.

    We need to flatten the complex data to convert it into an individual column first , so that we can apply transformations on top of it. Kindly use Flatten transformation before Derive column transformation to achieve the same.

    Adding video for your reference:

    235633-changedatatype.gif

    To understand more about flatten transformation, kindly checkout this video: Flatten Transformation in Mapping Data Flow in Azure Data Factory

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png 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
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.