millhouse123
Active Member
- Joined
- Aug 22, 2006
- Messages
- 335
I have the code/function below and I would like to remove the section of code that removes columns and everything below it if necessary but when I do I get an error that Token is expected.
can someone tell me how I can get rid of the remove columns portion of the code?
can someone tell me how I can get rid of the remove columns portion of the code?
Code:
= (filepath,SheetName)=>
let
Source = Excel.Workbook(File.Contents(filepath), null, true),
#"1" = Source{[Name=SheetName]}[Data],
#"Changed Type" = Table.TransformColumnTypes(#"1",{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type text}, {"Column8", type text}, {"Column9", type text}, {"Column10", type text}, {"Column11", type text}, {"Column12", type text}, {"Column13", type text}, {"Column14", type text}, {"Column15", type text}, {"Column16", type text}, {"Column17", type text}, {"Column18", type text}, {"Column19", type text}, {"Column20", type text}, {"Column21", type text}, {"Column22", type text}}),
#"Removed Top Rows" = Table.Skip(#"Changed Type",4),
Custom1 = Record.Field(#"Removed Top Rows"{0},"Column2"),
Custom2 = #"Removed Top Rows",
#"Removed Top Rows1" = Table.Skip(Custom2,2),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows1"),
#"Removed Columns" = Table.RemoveColumns(#"Promoted Headers",{"GCREF Ln #", "Borrower", "Investor Portfolio", "Ownership %", "Beginning Balance", "Due Date", "Other Adj Princ", "Net Interest", "Late Charges", "Prepay Penalty", "Other Amts", "Next Pmt Date", "Ending Balance", "Column21", "Column22"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([CUSIP] <> null)),
#"Sorted Rows" = Table.Sort(#"Filtered Rows",{{"Investor Ln #", Order.Descending}}),
#"Reordered Columns" = Table.ReorderColumns(#"Sorted Rows",{"Date Pmt Rev'd", "CUSIP", "Investor Ln #", "Principal Collected", "Interest Collected", "Service Fee", "Remittance Amount"}),
#"Added Custom" = Table.AddColumn(#"Reordered Columns", "Enter Date", each Custom1),
#"Reordered Columns1" = Table.ReorderColumns(#"Added Custom",{"Enter Date", "Date Pmt Rev'd", "CUSIP", "Investor Ln #", "Principal Collected", "Interest Collected", "Service Fee", "Remittance Amount"})