Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Due to some maintenance operations, stambia.org will be switched to read-only mode during the 13th November. It will be possible to read and download, but impossible to post on the forums or create new accounts. For any question please contact the support team.

Topic-icon Question function yesterday for manipulation of files with name aleatory

More
25 Jun 2018 17:46 #1 by pruiz
pruiz created the topic: function yesterday for manipulation of files with name aleatory
function yesterday for manipulation of files with name aleatory and patron standard please help

Example:

today is 20180625


and i am need the file of yesterday

RPT_ACCESS_20180624.xlsx


thank you!
More
26 Jun 2018 12:02 - 26 Jun 2018 14:20 #2 by Thomas BLETON
Thomas BLETON replied the topic: function yesterday for manipulation of files with name aleatory
Hello,

The solution may depend on the context : do you want to define this file name in a mapping ? in a process ? Is it for a single file or a batch of files ?

Here is a quick example which can be used in a File Name property of a metadata or template :
RPT_ACCESS_%x{md:formatDate('yyyyMMdd', -1)}x%.xlsx

Please provide more information about your context, if you need a more specific example :)
Last Edit: 26 Jun 2018 14:20 by Thomas BLETON.
  • fuehara
  • fuehara's Avatar
14 Jan 2019 20:11 #3 by fuehara
fuehara replied the topic: function yesterday for manipulation of files with name aleatory
Hello!
How do I set a year ago?

Tks
More
14 Jan 2019 20:42 #4 by Thomas BLETON
Thomas BLETON replied the topic: function yesterday for manipulation of files with name aleatory
Hi,
As said above : The solution may depend on the context : do you want to define this file name in a mapping ? in a process ? Is it for a single file or a batch of files ?
  • fuehara
  • fuehara's Avatar
14 Jan 2019 20:45 #5 by fuehara
fuehara replied the topic: function yesterday for manipulation of files with name aleatory
Hi!
I want to use as a parameter in the filter of a mapping
More
14 Jan 2019 20:47 #6 by Thomas BLETON
Thomas BLETON replied the topic: function yesterday for manipulation of files with name aleatory
I'm not sure I understand what you need to do. Having a timestamped file name as a filter in the source of a mapping is not clear to me.
Please provide more details :)
  • fuehara
  • fuehara's Avatar
14 Jan 2019 20:52 #7 by fuehara
fuehara replied the topic: function yesterday for manipulation of files with name aleatory
Hi!
For example.
I want to set in a variable the date a year ago, 2018/01/14.
Using the expression "% x {md: formatDate ('yyyyMMdd')} x%"

I found the article below:
stambia.org/component/content/article?id...es-with-dynamic-name

But it does not show me how to set a year ago.
  • fuehara
  • fuehara's Avatar
14 Jan 2019 20:55 #8 by fuehara
fuehara replied the topic: function yesterday for manipulation of files with name aleatory
I could put:
% x {md: formatDate ('yyyyMMdd', "-365")} x%,
but it would have problem when the year is leap year.
More
15 Jan 2019 17:33 - 15 Jan 2019 17:35 #9 by Thomas BLETON
Thomas BLETON replied the topic: function yesterday for manipulation of files with name aleatory
Hi,
You are right : doing -365 days is not exact with leap years.
The alternate solution to substract 1 digit from the Year is also false when executed on the 29th of February in a leap year.
What would you expect as a valid result in this case, by the way ?
29/02/2020 minus one year = ?
Last Edit: 15 Jan 2019 17:35 by Thomas BLETON.