azure data factory - ADF decimal column output - Stack Overflow

We have an ADF pipeline to transform an Excel file to CSV.The Excel file has numeric column containing

We have an ADF pipeline to transform an Excel file to CSV.

The Excel file has numeric column containing decimal data.

Example:

Data
15000000
23219284.250000

We have an ADF pipeline to transform an Excel file to CSV.

The Excel file has numeric column containing decimal data.

Example:

Data
15000000
23219284.250000

We tried using double data type for this column in Data Flow source.

However, it outputs them as:

CSV Output using Double
1.5E7
2.321928425E7

We also tried using Decimal (18,6) for this column but it outputs trailing zeros:

CSV Output using Decimal (18,6)
15000000.000000
23219284.250000

How can I change the CSV output such a way that it removes the trailing zeros and does not use exponential notation (without explicitly using Decimal(18,2) data type)?

Expected CSV Output
15000000
23219284.25
Share Improve this question edited Mar 10 at 13:40 developer asked Mar 10 at 12:07 developerdeveloper 1,6274 gold badges38 silver badges86 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

How can I change the CSV output such a way that it removes the trailing zeros and does not use exponential notation (without explicitly using Decimal(18,2) data type)?

Follow the below steps to get the expected output:

Step1: Please try using the following expression to achieve the expected results. replace(toString(toDecimal(Data)),'.00','')

Step2: I have used the same sample data that you provided.

Step3: Use the following expression in the derived column as required. replace(toString(toDecimal(Data)),'.00','')

Step4: Output is as expected as per your requirement.

This should get you exactly what you need and no need for an entire Data Flow. This is a simple ADF Copy activity.

1. Test File

2. ADF COPY SOURCE

3. ADF SINK

4. ADF MAPPING (IMPORTANT)

5. Output (Note: If you don't expand the column, it will visually show the 1.5E+08, I will show what I mean below)

Example of it not expanded on the column and visual of it in VS Code (not Excel Desktop):

Cheers!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744847694a4596941.html

相关推荐

  • azure data factory - ADF decimal column output - Stack Overflow

    We have an ADF pipeline to transform an Excel file to CSV.The Excel file has numeric column containing

    2天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信