다음을 통해 공유


Table.FromList

통사론

Table.FromList(list as list, optional splitter as nullable function, optional columns as any, optional default as any, optional extraValues as nullable number) as table

소개

목록의 각 항목에 선택적 분할 함수splitter적용하여 list 목록을 테이블로 변환합니다. 기본적으로 목록은 쉼표로 분할되는 텍스트 값의 목록으로 간주됩니다. 선택적 columns는 열의 수일 수도 있고, 열 목록이거나 TableType일 수 있습니다. 선택적인 defaultextraValues가 지정될 수 있습니다.

예제 1

기본 분할자를 사용하여 목록에서 테이블을 만듭니다.

사용량

Table.FromList(
    {"a,apple", "b,ball", "c,cookie", "d,door"},
    null,
    {"Letter", "Example Word"}
)

출력

Table.FromRecords({
    [Letter = "a", #"Example Word" = "apple"],
    [Letter = "b", #"Example Word" = "ball"],
    [Letter = "c", #"Example Word" = "cookie"],
    [Letter = "d", #"Example Word" = "door"]
})

예제 2

사용자 지정 분할자를 사용하여 목록에서 테이블을 만듭니다.

사용량

Table.FromList(
    {"a,apple", "b,ball", "c,cookie", "d,door"},
    Splitter.SplitByNothing(),
    {"Letter and Example Word"}
)

출력

Table.FromRecords({
    [#"Letter and Example Word" = "a,apple"],
    [#"Letter and Example Word" = "b,ball"],
    [#"Letter and Example Word" = "c,cookie"],
    [#"Letter and Example Word" = "d,door"]
})

예제 3

Record.FieldValues 분할자를 사용하여 목록에서 테이블을 만듭니다.

사용량

Table.FromList(
    {
        [CustomerID = 1, Name = "Bob"],
        [CustomerID = 2, Name = "Jim"]
    },
    Record.FieldValues,
    {"CustomerID", "Name"}
)

출력

Table.FromRecords({
    [CustomerID = 1, Name = "Bob"],
    [CustomerID = 2, Name = "Jim"]
})