Forum Discussion
owlet0214
6 years agoHelper I
When the file name changes depending on the date
Hello, from Japan If the file name changes depending on the date, can I fix it by modifying the code? For example, in the case of today, an expression describing yesterday's date is placed. G...
- Anonymous6 years ago
let
partDate=DateTime.ToText(Date.AddDays( DateTime.LocalNow(),-1), "yyyy-MM-dd"),
Origine = Excel.Workbook(Web.Contents("https://www.aaa.com/files/documents/worldwide-"& partDate & ".xlsx"), null, true)
in Origine
MattAllington
6 years agoCommunity Champion
What I normally do is this.
select "load from folder" instead of load from file
don't combine the files, but click Transform
add a new column that extracts the date, convert it to a date
sort descending so it keeps the latest
load the top file (click binary, but then change the ref to be absolute ref to the first file). I normally do this by changing the code name="yada", Folder="something" and replace it with {0}
Uno707
3 years agoFrequent Visitor
This is what worked for me. Wish I saw this sooner!