Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I received files without date inside, so I need to load it from filename, but problem that date in following format:
GenF JUNE WK 3.xlsx
In this case how I should determine week ending date for I example I know that JUNE WK 3 = 2015-06-20.
I think I should create calendar and then check the week number and month.
Please advise the best way.
Thanks,
Vitaliy
just to make sure:
you know that there is a function FileTime() that returns the "last modified" timestamp of a file?
regards
Marco
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
let filename='GenF JUNE WK 3.xlsx';
let year=year(today());
let month=num(month(Date#($(year) & subfield('$(filename)', ' ', 2) & '01', 'YYYYMMMMDD')));
let weeknum=replace(subfield('$(filename)', ' ', 4), '.xlsx', '');
let weeknum=week(monthstart( makedate(year, month) )) + (weeknum) - 1;
let date=date(MakeWeekDate($(year), $(weeknum))+5);
EDIT
this line doesn't work for May (I think because the format is MMMM and May is 3 char
let month=num(month(Date#($(year) & subfield('$(filename)', ' ', 2) & '01', 'YYYYMMMMDD')));
this works for May too
let month=num(month(Date#($(year) & '-' & subfield('$(filename)', ' ', 2) & '-' & '01', 'YYYY-MMMM-DD')));
Thank you it works good, but I find on thing, for example May week 4 in this logic = 2015/05/23 .
In my calendar it should be 2015/05/30. Could you advise what should I do?
2015/05/30 is the fifth saturday in may.
please specify your month-week count.
regards
Marco
Marco,
We use NRF calendar.