Forum Discussion
gabrielrosa
6 years agoFrequent Visitor
Process PDF data in just one line.
Hello, buddies.
how can i process these PDF data in just one line?
All those 13 lines, are data about 1 archive.
Hi gabrielrosa
please paste the code into the advanced editor and follow the code:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXLLTM1JATEMDZRidZDEjIAMIzQxYyDDGCJmhKzXBE0MxDBFEwPpNQOKxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", type text}, {"Column3", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Partition", each _, type table [Column1=number, Column2=text, Column3=number]}}), #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.FromRows({[Partition][Column3]}, [Partition][Column2])), #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Field1", "Field2", "Field3"}, {"Field1", "Field2", "Field3"}), #"Removed Other Columns" = Table.SelectColumns(#"Expanded Custom",{"Partition"}) in #"Removed Other Columns"
3 Replies
- amitchandakSuper User
ImkeF , can you help
- ImkeFCommunity Champion
Hi gabrielrosa
please paste the code into the advanced editor and follow the code:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXLLTM1JATEMDZRidZDEjIAMIzQxYyDDGCJmhKzXBE0MxDBFEwPpNQOKxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", type text}, {"Column3", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"Column1"}, {{"Partition", each _, type table [Column1=number, Column2=text, Column3=number]}}), #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.FromRows({[Partition][Column3]}, [Partition][Column2])), #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Field1", "Field2", "Field3"}, {"Field1", "Field2", "Field3"}), #"Removed Other Columns" = Table.SelectColumns(#"Expanded Custom",{"Partition"}) in #"Removed Other Columns" - AnonymousNot applicable
HI gabrielrosa,
I do not so clear to your requirement, can you please explain more about your requirements or share some expected results? It will help us to clarify your requirements.
How to Get Your Question Answered Quickly
If you only mean to group and merge your records to one, you can refer to ImkeF's query and formulas.
Regards,
Xiaoxin Sheng