Welcome Guest! Log in
×

Notice

The forum is in read only mode.
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…

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

More
25 Jun 2018 17:46 #1 by pruiz
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
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
Hello!
How do I set a year ago?

Tks
More
14 Jan 2019 20:42 #4 by Thomas BLETON
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
Hi!
I want to use as a parameter in the filter of a mapping
More
14 Jan 2019 20:47 #6 by Thomas BLETON
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
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
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
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.