ADF数据映射流程中是否可以进行行引用

问题描述 投票:0回答:1

我们收到了一个数据集,其中的数据按类别分档,并希望将分档“部门”放入其自己的列中,因此输出应为“部门”、“员工代码”、“工资”并删除底部有额外的行。有办法实现这个目标吗?

样本输出

azure-data-factory azure-pipelines-build-task data-mapping
1个回答
0
投票

为了创建一个名为“部门”的新列并在该列中填充数据,您可以按照以下步骤操作。

  1. source transformation
    用于输入数据。

enter image description here

  1. derive transformation
    用于添加一个名为“Department”的新列。该列的表达式如下
    iif(isNull(toInteger(EmployeeCode)),EmployeeCode,toString(null()))
    。添加名为
    dummy
    的另一列,并将值指定为
    1

enter image description here

    添加
  1. Surrogate Key transformation
    来为数据流中的每一行生成代理键。

enter image description here

enter image description here

  1. window tansformation
    用于使用
    last
    函数填充“部门”列中的缺失值。

gif1

  1. filter transformation
    用于过滤掉“Salary”列为空的行。然后使用
    select transformation
    选择“EmployeeCode”、“Salary”和“Department”列。

参考https://learn.microsoft.com/en-us/azure/data-factory/data-flow-script#fill-down

© www.soinside.com 2019 - 2024. All rights reserved.