Calendar week in the file name

Hello everyone

I would like to save the output file under the name ‘sample_XX.xlsx’, where XX is the current calendar week. Can anyone help me please?

I think you need to use a small trick. Add when you read input data with the Meta Data the current date into a column. With the calculate transformation you can get the week of year out of this date.
When writing the file you need to use the output to „multiple file“ and use the column with the calculated wee as part of the output file name. As the calculated value is the same in each row you get only one file written, but with the calendar week in it.
I cannot create an example, as I havn‘t my notebook currently with me.

This demonstrates the approach described by @olaf.

week-as-file-name.transform (4.1 KB)

A simpler approach is to do this:

But it will give you the date as year_month_day, rather than the week.

Many thanks for the tips and the sample script. I have rebuilt this in my script but I always get the error messages below when creating the output file and I don’t know why.

@Klaus
It might be because you haven’t saved the .transform file, so it doesn’t know what folder it is relative to.

If you set a full path (e.g. C:\users\Klaus\tele_14.xlsx) in the Files column column, the issue should go away.

Many thanks, that solved the problem. :+1:

1 Like

@Admin
EDT has already so many features, but as a wish for a future version, it would be grand to be able to format the date for the filename with the usual parameters yyyy MM dd mm ss ww, to skip all otherwise required transformations.

1 Like

The current {date}, {time} and {datetime} are quite limited.

They are already a very good starting point, sky is the limit (the format could also include quarters qq, day of the year 1-366, day of the week 1-7 (a bit ambiguous as it could be Sun or Mon) etc.

The following additional file name variables will be available in the next release:

{day}
{month}
{year}
{hour}
{minute}
{second}
{computername}
{username}

2 Likes

Some extra filename variables are now available in the latest release: