let
Source = Folder.Files("C:\Users\moulda\Desktop\Man Subs 20211101"),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Removed Errors1" = Table.RemoveRowsWithErrors(#"Removed Other Columns1", {"Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Errors1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"Stock Location Information - place where stock is stored overnight", type text}, {"Column2", type any}, {"Column3", type text}, {"Column4", type text}, {"Column5", type text}, {"Column6", type text}, {"Column7", type any}, {"Column8", type any}, {"Stock received by storage location (do not use for transfers to clinics where the remainder is returned to the storage location at the end of day)", type any}, {"Column10", type text}, {"Column11", type text}, {"Stock transferred out of storage location (do not use for transfers to clinics where the remainder is returned to the storage location at the end of day)", type any}, {"Column13", type text}, {"Column14", type text}, {"Vaccine administered during downtime (required for doses not recorded online)", type any}, {"Column16", type any}, {"Significant wastage event (greater or equal to 5 vials wasted)", type any}, {"Column18", type text}, {"Column19", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"01.11.21 EOD SBVL .xlsx", type text}, {"Name of Stock Storage Location", type text}, {"Stock Balance Date", type date}, {"Authorised Contact Person", type text}, {"Vaccine", type text}, {"Batch", type text}, {"Comments", type text}, {"Usable stock on hand at end of day:#(lf)#(lf)Whole, unopened vials", Int64.Type}, {"Stock in quarantine at end of day#(lf)#(lf)Whole, unopened vials", Int64.Type}, {"Stock received INTO storage location#(lf)#(lf)Whole, unopened vials", Int64.Type}, {"Transfer INTO Type", type text}, {"Source of transfer", type text}, {"Stock transferred OUT OF hub#(lf)#(lf)Whole, unopened vials", Int64.Type}, {"Transfer OUT OF Type", type text}, {"Stock destination", type text}, {"Downtime Administered Today#(lf)#(lf)(Vials)", Int64.Type}, {"Downtime Administered Today#(lf)#(lf)(Doses)", Int64.Type}, {"Significant wastage event#(lf)#(lf)Vials", Int64.Type}, {"Significant wastage type", type text}, {"Wastage Comments", type text}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type1", each ([Stock Balance Date] = #date(2021, 11, 1))),