【问题标题】:Split out JSON input and apply same JSON field name as column name in Alteryx workflow拆分 JSON 输入并在 Alteryx 工作流中应用与列名相同的 JSON 字段名称
【发布时间】:2020-02-05 18:57:06
【问题描述】:

我正在使用 Alteryx 2019.3,并希望构建一个使用 JSON 作为输入的工作流。当它读取 JSON 时,它会将 JSON 键值对放入名为 JSON_Name 和 JSON_ValueString 的列中

在我模拟的示例中,下面 JSON 中的字段名称在 JSON_Name 列中如下所示:

customer.0.name
customer.0.contactDetails.0.company
customer.0.contactDetails.0.addressDetails.0.address
customer.0.contactDetails.0.addressDetails.0.addressType
customer.0.departments.0.name

我想要做的是将其拆分为不同的表,并将 JSON_Name 值的最后一部分作为列名,因此它看起来像这样(大写显示表名):

CUSTOMER
customerId

CONTACTDETAILS
customerId
company

ADDRESSDETAILS
customerId
address
addressType

DEPARTMENTS
customerId
name

如何在 Alteryx 中执行此操作,以及当我在 JSON 列表中可能有多个条目时如何使其工作?

感谢您的帮助

JSON 输入(例如模拟)

{
    "id": "1234",
    "contactDetails": [{
        "company": "company1",
        "addressDetails": 
        [{
            "address": "City1",
            "addressType": "Business"
        }]
    }]
    "departments": 
    [{
        "name": "dept1
    }]
}

【问题讨论】:

    标签: alteryx


    【解决方案1】:

    您可以使用文本到列,然后使用一系列过滤器将其拆分为不同的数据集(表)来执行此操作。您可能希望使用交叉表来获得正确的表格格式。

    【讨论】:

      猜你喜欢
      • 2022-11-11
      • 2016-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-11-20
      • 2020-01-05
      • 2016-06-02
      • 1970-01-01
      相关资源
      最近更新 更多