본문으로 건너뛰기

Table.Unpivot

테이블의 열 집합을 특성-값 쌍으로 변환합니다.

Syntax

Table.Unpivot(
table as table,
pivotColumns as list,
attributeColumn as text,
valueColumn as text
) as table

Remarks

각 행에 포함된 값의 다른 부분과 결합하여 테이블의 열 집합을 특성-값 쌍으로 변환합니다.

Examples

Example #1

({[ key = "x", a = 1, b = null, c = 3 ], [ key = "y", a = 2, b = 4, c = null ]}) 테이블의 "a", "b" 및 "c" 열을 특성-값 쌍으로 피벗 해제합니다.

Table.Unpivot(
Table.FromRecords({
[key = "x", a = 1, b = null, c = 3],
[key = "y", a = 2, b = 4, c = null]
}),
{"a", "b", "c"},
"attribute",
"value"
)

Result:

Table.FromRecords({
[key = "x", attribute = "a", value = 1],
[key = "x", attribute = "c", value = 3],
[key = "y", attribute = "a", value = 2],
[key = "y", attribute = "b", value = 4]
})

Category

Table.Column operations