Forum Discussion
Mederic
2 years agoPost Patron
Extract range in a pdf
Hello, I'm working on a single pdf file. Once I've finished all the transformation steps, I'd like to turn it into a function However, I'm having trouble selecting the range in the table I've add...
Mederic
2 years agoPost Patron
Hello,
after a headache, I got around the problem of my previous message,
Taking "Table003" instead of the "Page001", it worked for the 23 pdf, even though I would have liked to use "Page001"
I also simplified the code M (see below)
One question please, is it possible to combine the 2 lines "Custom3" and "Custom2" in one ?
Otherwise, I have not quite finished yet, I still have 4 columns to add but it is more complicated there
Thanks in advance
Best regards
(file_binary)=>
let
//Source = File.Contents(AllPath[Column1]{0}),
Custom1 = Pdf.Tables(file_binary),
#"Filtered Rows3" = Table.SelectRows(Custom1, each ([Id] = "Table003")),
Custom3 = Table.TransformColumns(#"Filtered Rows3", {"Data", each Table.PromoteHeaders(_)}),
Custom2 = Table.TransformColumns(Custom3, {"Data", each Table.SelectRows(_, each ([#"Unit Price"] <> null and [#"Unit Price"] <> "" ))}),
#"Removed Other Columns" = Table.SelectColumns(Custom2,{"Data"}),
#"Expanded Data" = Table.ExpandTableColumn(#"Removed Other Columns", "Data", {"Reference", "Designation", "Qty/Time", "Unit Price", "Amount excl. taxes"}, {"Reference", "Designation", "Qty/Time", "Unit Price", "Amount excl. taxes"})
in
#"Expanded Data"