Craigc3814
Board Regular
- Joined
- Mar 7, 2016
- Messages
- 217
I have been compiling excel files from a network folder for a few months now, for whatever reason this months file will not work. I am getting an error on the Get Contents formula found on Ken Puls site. It is pulling all other files in, but generates an error on this months. The only thing I knew to check was to make sure the sheet name or column headings had not changed. Found an issue with the sheet name and that atleast brings the data in but every single line now generates an error.
Has anyone had anything similar? I dont really even know what I am looking for. Below is the code. The file name is slightly different than 6 of the other files they had sent but there is one other with a completely different file name that works fine.
let
Source = Folder.Files("W:\DATA\Operations\Procurement\Utility Locating Services\811 Invoices"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each fnGetContents([Folder Path]&[Name])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"request_no", "CDC", "type", "county", "township", "contractor", "address", "sortfullname", "workcode_id", "cost", "util_id", "transmit_date", "transmit_time", "dateofwork", "starttime", "endtime", "sba_desc", "workfor", "Caller", "WorkType", "DueDate", "PYPN_flag", "invoice_no", "dateofinv", "district", "Sales_Tax_City", "Sales_Tax_State"}, {"request_no", "CDC", "type", "county", "township", "contractor", "address", "sortfullname", "workcode_id", "cost", "util_id", "transmit_date", "transmit_time", "dateofwork", "starttime", "endtime", "sba_desc", "workfor", "Caller", "WorkType", "DueDate", "PYPN_flag", "invoice_no", "dateofinv", "district", "Sales_Tax_City", "Sales_Tax_State"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"transmit_date", type date}, {"dateofwork", type date}, {"DueDate", type date}, {"dateofinv", type date}, {"starttime", type time}, {"endtime", type time}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "Work Date - Transmit", each [dateofwork]-[transmit_date]),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Work Date - Transmit", Int64.Type}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type1", "Work On Time", each if[DueDate]<[dateofwork] then "Late" else null),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Custom2",{{"transmit_time", type time}}),
#"Added Custom3" = Table.AddColumn(#"Changed Type2", "Custom", each [DueDate]-[transmit_date]),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom3",{{"Custom", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type3",{{"Custom", "Transmit To Due"}})
in
#"Renamed Columns"
Has anyone had anything similar? I dont really even know what I am looking for. Below is the code. The file name is slightly different than 6 of the other files they had sent but there is one other with a completely different file name that works fine.
let
Source = Folder.Files("W:\DATA\Operations\Procurement\Utility Locating Services\811 Invoices"),
#"Added Custom" = Table.AddColumn(Source, "Custom", each fnGetContents([Folder Path]&[Name])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"request_no", "CDC", "type", "county", "township", "contractor", "address", "sortfullname", "workcode_id", "cost", "util_id", "transmit_date", "transmit_time", "dateofwork", "starttime", "endtime", "sba_desc", "workfor", "Caller", "WorkType", "DueDate", "PYPN_flag", "invoice_no", "dateofinv", "district", "Sales_Tax_City", "Sales_Tax_State"}, {"request_no", "CDC", "type", "county", "township", "contractor", "address", "sortfullname", "workcode_id", "cost", "util_id", "transmit_date", "transmit_time", "dateofwork", "starttime", "endtime", "sba_desc", "workfor", "Caller", "WorkType", "DueDate", "PYPN_flag", "invoice_no", "dateofinv", "district", "Sales_Tax_City", "Sales_Tax_State"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"transmit_date", type date}, {"dateofwork", type date}, {"DueDate", type date}, {"dateofinv", type date}, {"starttime", type time}, {"endtime", type time}}),
#"Added Custom1" = Table.AddColumn(#"Changed Type", "Work Date - Transmit", each [dateofwork]-[transmit_date]),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Work Date - Transmit", Int64.Type}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type1", "Work On Time", each if[DueDate]<[dateofwork] then "Late" else null),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Custom2",{{"transmit_time", type time}}),
#"Added Custom3" = Table.AddColumn(#"Changed Type2", "Custom", each [DueDate]-[transmit_date]),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom3",{{"Custom", Int64.Type}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type3",{{"Custom", "Transmit To Due"}})
in
#"Renamed Columns"