How to Date Stamp Your Data in The Knime Analytics Platform

November 12, 2022

Date Stamp Your Data in Knime

In today’s blog post we’re going to walk-through how-to time stamp your data in Knime. But Nick, why would we ever want to time stamp our data you say?  

We’ll the biggest reason we’d want to do such a thing is to build a data repository over time that we can look back and analyze. For example, if we’re Amazon seller’s, we might want to understand how many days our processes take on average to get an order from paid, to marked ready for shipping, to out the door and delivered to our end customers. This type of insight from our data can help us understand where our soft spot is, so we can focus improvement there, and ultimately provide an elevated shopping experience for our customers. But, to be able to track this, we need to timestamp our data and our processes.  

Now that we’ve cleared that up, lets dive into the tutorial. To get started, I will be using data from the below pictured workflow:  

Knime Workflow for Date Stamping Data
Knime Workflow for Date Stamping Data

Example Data Set

The data here has been processed so that a customer service team member (from the above example) can upload the output to Amazon’s servers and link Tracking numbers to the respective orders.  

Example Data from Analytic Iron
Example Data from Analytic Iron

Our goal will be to add a time stamp to this data. The date needs to be based on the date & time of running the workflow, so we can’t simply hardcode today’s date into the data.  

We have two options to dynamically create the date stamp, we can use either the “Create Date&Time” node or we can use the “Column Expressions” node. In this example, we’re going to use the Column Expressions node, since it’s the easiest to implement.

As a side note, the Column Expressions Node is one of my favorite nodes because of its ability to handle a wide variety of manipulations along with its ability to execute logic-based manipulations. You can learn more on the column expressions node in this video on my YouTube channel.  

Column Expressions in the Node Repository

Let’s get started! We can find the Column Expressions node in the Node Repository simply by searching “Column Expressions” and dragging and dropping onto our workflow.  

Column Expressions in the Node Repository
Column Expressions in the Node Repository

After we make our connection, we can double-click into the node to start our configuration. This is what the configuration menu looks like:  

The Default Settings in the Column Expressions Node
The Default Settings in the Column Expressions Node

Column Expressions Configuration Menu

The menu is rather straight-forward, simply click on the plus sign in the top left to create a new expression. Adding an expression gives us the option to create the expression, set the expression’s column type (string, number, date etc.), create the expression’s output as a new column or replace an existing column with the expressions output. Below is what the configuration menu looks like after we’ve clicked the plus sign and added an expression.

Columns Expressions with a New Expression Added
Columns Expressions with a New Expression Added

In the lower portion of the configuration menu we can see the expression editor. This expression editor is where we’ll write a little bit of code (don’t be intimidated, you’ll see how easy it is to setup) that’s executed to create the output we’re looking for.  

Right above the expression editor are three drop-down options labeled “column”, “variable”, and “function”. These help us write out our code in the expression editor, you simply double-click on the value and its drops down into the expression editor.  

Configuring the Column Expressions Node

For our tutorial we’re going to use a date function, so we’ll click on the function list and search for the “today()” function at the bottom of the list. Once you we find it, we can double-click on the function and it should appear in the expression editor. Next, we’ll adjust the options on the top end on the menu: set the column type to local date and set the column name to “Date Processed”.

Date Function in the Column Expressions Node
Date Function in the Column Expressions Node

Our column expressions node is now configured and ready to be executed. Yes, it’s that easy to setup. We can click apply and ok to close out the configuration menu. Then we’ll right click on our node and select execute. Our output data should look like the screen shot below:

Date Stamped Data in The Knime Analytics Platform
Date Stamped Data in The Knime Analytics Platform

That’s all there is to it, our data is now date stamped! The date stamp gives us the ability to look back over time and audit our processing times on this specific step of the customer journey. This insight will help us keep our operation running smoother which in turn helps provide our customers the best possible experience when they shop with us!  

If you’re interested in applying similar metrics and datapoints to your data, don’t hesitate to reach out for personalized consulting.

Book a call to explore the different avenues the Analytic Iron team can help You extract insights from Your Data.
BOOK a Discovery cALL