DATA STORIES | DATE DIFFERENCE | KNIME ANALYTICS PLATFORM

KNIME Date Difference Calculator

A fully automated solution to calculate date difference, due dates or manage shipment dates

BI-FI BLOGS
Low Code for Data Science

--

As first published in BI-FI Blogs

Photo by Towfiqu barbhuiya on Unsplash.

In this article, we will take a look at the Date Difference Calculator workflow created using KNIME Analytics Platform, and explore how to use it.

This project is useful for calculating due dates, managing shipment dates or simply calculating the date difference to see:

  • How many days and working days have passed from the Start Date
  • How many weeks have passed from the Start Date
  • How many days and working days are left until the End Date
  • How many weeks are left until the End Date

This workflow leverages flow variables, Date&Time extraction nodes and several data manipulation nodes for date calculations. You can copy these node configurations and apply them to your own projects as well.

You can download the workflow “Date Difference Calculator” for free from the KNIME Community Hub.

Download the workflow “Date Difference Calculator” from the KNIME Community Hub.

Now let’s break down the workflow to see how it works.

First, in STEP 1, we execute the component, open the interactive view, and enter the Start Date and End Date for the calculation.

Next, we run the STEP 2 metanode. This metanode creates a date range with your Start-End Dates and calculates the duration using the Date&Time Difference node.

After that, in STEP 3.1, we calculate how many days, work days and weeks have passed. To calculate the work days, first we extract the day number from the dates and if the date number is greater than 5 (Friday), that day will labeled as weekend. Otherwise, it is labelled as work day.

For the STEP 3.2, to calculate how many days left till the End Date, we need to know which date is the execution date. We use the nodes below to find the execution date and pass it as a flow variable for the calculations.

Finally, we can execute the last component to view the dashboard with all the calculations in a table format at once.

We have explained the workflow details where the only manual work is entering just once the start and end dates. After that, you can run the workflow and it will create the tables for you.

If you liked this article, please don’t forget to share it and leave a comment below!

--

--

BI-FI BLOGS
Low Code for Data Science

BI-FI Blogs provides useful materials, examples, tutorials about: SQL Server, PowerBI, Python, VBA, Data Analysis, Knime, and many more...