【发布时间】:2021-02-10 01:17:39
【问题描述】:
我是电源查询的新手。我正在解析 JSON。当我使用 Power Query 扩展它时,我有一个数组名称为“类别”,它为每个类别创建三行,而我只想保留一行并想为每个类别创建 3 个单独的列,如 category1、category2、category3。
这是我的代码
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"id", Int64.Type}, {"no", type text}, {"complete", Int64.Type}, {"json", type text}}),
#"Parsed JSON" = Table.TransformColumns(#"Changed Type",{{"json", Json.Document}}),
#"Expanded json" = Table.ExpandRecordColumn(#"Parsed JSON", "json", {"title", "price", "StoreName", "ratings", "merchant", "categories", "VariantB", "detailA", "detailB", "bullets", "images", "description"}, {"title", "price", "StoreName", "ratings", "merchant", "categories", "VariantB", "detailA", "detailB", "bullets", "images", "description"})
in
#"Expanded json"
【问题讨论】:
标签: powerquery