Options

How to Add Timestamps

MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,507 RM Data Scientist
edited November 2018 in Knowledge Base

Question

I would like to use a Write or Store operator but tag the result with a timestamp, how do I do this?

Answer

In order to add a timestamp we will use macros. If you do not yet know about macros, please have a look at this article.

 

Using Generate Macro

You can use the Generate Macro operator to generate a new macro named e.g. timestamp. To do this we use the equation:

 

date_str_custom(date_now(),"dd-MM-yy")

 

the format of the date can be changed easily to include for example the second or the minute. This can then be used in the path of store or Write Excel/CSV/... with the standard macro notation. For a Store operator it looks like this:

 

//Local Repository/my data %{timestamp}

 

The corresponding process is attached to this article.

Using Built-In Macros

Instead of creating your own macro, you can also use the built-in macro t. This macro is always available. For the Store example it would be used like this

 

 //Local Repository/my data %{t}

 

This method is faster than the previously mentioned but you cannot change the date format of %{t} without using Generate Macro. The attached process is also showing the usage of t.

- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany
Sign In or Register to comment.