I really need some help on merging data in Power Query. I am importing data from a file (from a network drive) and also pulling data from a static table. However I am trying to obtain a match with headers 1) Container Number 2) ETA
Unfortunately the ETA's dont exactly match up, but im trying to put a rule which says Match if within +/- 5 days.
let
Source = Table.NestedJoin(#"Allotrac Data", {"Container NO.", "VSL ETA"}, #"CAFS Data", {"container", "ETA"}, "CAFS Data", JoinKind.LeftOuter),
#"Expanded CAFS Data" = Table.ExpandTableColumn(Source, "CAFS Data", {"vessel", "voyage", "ETA", "Discharged", "GateOut", "ISOCODE"}, {"CAFS Data.vessel", "CAFS Data.voyage", "CAFS Data.ETA", "CAFS Data.Discharged", "CAFS Data.GateOut", "CAFS Data.ISOCODE"}),
#"Reordered Columns" = Table.ReorderColumns(#"Expanded CAFS Data",{"Source.Name", "S.No", "Job Id", "Job Reference", "Job Date", "Client", "Supplier / Pickup Point", "Customer / Delivery point", "Lot ID", "Inventory ID", "Products", "Volume", "Pickup Date/Time", "Delivery Date/Time", "Delivery Type", "Created By", "Created Date/Time", "Updated By", "Updated Date/Time", "Total Price", "Fleet", "Subcontractor", "Vehicle Rego", "Driver", "Salesperson", "Total Weight", "Assigned Weight", "Delivered Weight", "Price Description", "Job Status", "Comments", "Subbie Rate", "Site Inspection", "Container NO.", "Customs Entry", "CUST PO", "Docket #", "Vehicle Identifier", "SHIFT", "VSL ETA", "ECN", "VSL Name", "PIN TSW", "VBS #", "VBS Date", "DMR LFD", "DET LFD", "Cust Notes", "SHIP Line", "RAND KI", "Service", "Doors", "Grid", "Driver Notes", "BILL CLIENT", "Customs", "MPI HOLD", "SHIP HOLD", "MON HOLD", "PLAN HOLD", "Delivery Date", "HSW", "Broker", "DG Class", "Equipment Type", "CAFS consol", "Unpack consol", "Special Handling", "LOCATION", "ATA", "AVAILABLE", "OPERATIONAL COMMENTS", "Storage", "Reuse", "FullMT", "CHEP DEL", "MPLT DEL", "Master Bill", "DAMAGED", "CHEP RET", "MPLT RET", "REPRICE", "Dehire Flag", "Parent", "Xero Invoice", "Xero User", "Xero Date", "MYOB Invoice", "MYOB User", "MYOB Date", "CSV Invoice User", "CSV Invoice Date", "CAFS Data.ISOCODE", "CAFS Data.vessel", "CAFS Data.voyage", "CAFS Data.ETA", "CAFS Data.Discharged", "CAFS Data.GateOut"}),
#"Removed Columns" = Table.RemoveColumns(#"Reordered Columns",{"CSV Invoice User", "CSV Invoice Date"})
in
#"Removed Columns"
Something tells me I should be trying to use the Where function
ie Where 1=1 AND ETA Between GETDATE()-5 AND GETDATE ()+5
However I have no idea how to insert that (im very new to this)
Ive tried adding the above code and joining, but it doesnt seem to work. Im missing something