Extract the date to create a report date column from Source.Name column

jajatidev

Board Regular
Joined
Jul 29, 2016
Messages
69
Office Version
  1. 365
Platform
  1. Windows
Hi,
I have 15 Excel reports sourced from SharePoint.
The Source.Name column captures the report name which has the date mentioned.
Please advise how I can create a Report Date column that only captures the date from the Source.Name column so that I can hide the Source Name column before loading data for visualization.

Source.Name
Direct SJ3 +Global Tier-1 order Unclean report-01-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-02-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-03-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-04-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-05-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-06-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-07-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-08-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-09-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-10-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-11-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-12-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-13-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-14-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-15-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-16-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-17-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-18-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-19-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-20-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-21-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-22-09-2023.xlsx
Direct SJ3 +Global Tier-1 order Unclean report-23-09-2023.xlsx
 
Thanks for the comments. I dig the fact that I can show some stuff you haven't seen before.

It has been a while since I played around with RegExp in PQ.

Playing around with it, here is a cleaner version.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    RX = (str,exp)=>
        let
            Source = Web.Page(
                     "<script>document.write('" & str & "'.match('" & exp & "')[0]);</script>")
                     [Data]{0}[Children]{0}[Children]{1}[Text]{0}
        in
            Source,
    GetDate = Table.AddColumn(Source, "Date", each RX([Source.Name],"[0-9]{2}([\-/ \.])[0-9]{2}[\-/ \.][0-9]{4}"))
in
    GetDate
 
Upvote 0

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,215,069
Messages
6,122,952
Members
449,095
Latest member
nmaske

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top