Home > Mobile >  Error: Splitting rows into separate rows on all columns in Power Query
Error: Splitting rows into separate rows on all columns in Power Query

Time:12-24

I had a problem spliting data in rows, used the solution provided by horseyride in the following link

enter image description here

let
    Source = Pdf.Tables(File.Contents("C:\Users\gmall\OneDrive\EF personales\EF\Temporales\IBK_Sueldo_PEN.pdf"), [Implementation="1.3"]),
    Table002 = Source{[Id="Table002"]}[Data],
    TableTransform = Table.Combine(List.Transform(List.Transform(Table.ToRecords(Source),
        (x) => List.Transform(Record.ToList(x),each Text.Split(_,"#(lf)"))),
            each Table.FromColumns(_,Table.ColumnNames(Source))))
in
    TableTransform

Please let me know how to solve this issue:

Expression.Error: We cannot convert a value of type Table to type Text.
Details:
    Value=[Table]
    Type=[Type]

CodePudding user response:

You need to use Table002 in step3 since that is the prior step name, not Source, which was the prior step name in my other answer

let
Source = Pdf.Tables(File.Contents("C:\Users\gmall\OneDrive\EF personales\EF\Temporales\IBK_Sueldo_PEN.pdf"), [Implementation="1.3"]),
Table002 = Source{[Id="Table002"]}[Data],
TableTransform = Table.Combine(List.Transform(List.Transform(Table.ToRecords(Table002),
    (x) => List.Transform(Record.ToList(x),each Text.Split(_,"#(lf)"))),
        each Table.FromColumns(_,Table.ColumnNames(Table002))))
in
TableTransform
  • Related