Knime Date Difference Calculator

   In this post, we will take a look at the Knime Date Difference Calculator created by BI-FI Blogs 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 has passed from Start Date
  • How many weeks has passed from Start Date
  • How many days and working days left till End Date
  • How many weeks left till End Date


   This workflow contains; flow variable usage, date-time extraction nodes and many advanced syntax for date calculations. You can copy these node configurations for your own projects as well.

   You can download the workflow via link below. All the workflows created by BI-FI Blogs will be available on Knime Hub as well.  

Click to Check the Knime Date Difference Calculator















Workflow should look like this. Now let's break it down to see how it works.



First, execute and view the STEP 1 and 

enter the Start Date and End Date for the calculations.




Now,  just run the STEP 2 metanode. This metanode creates a date range with your Start-End Date and calculates the duration for the calculations.








   After that, STEP 3.1 calculates how many days, work days and weeks has passed. To calculate the work days, first we extract the day number of the dates and if date number is greater than 5 (Friday), that day will labeled as weekend. 







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 are using nodes on the right to find the execution date and pass it as a flow variable to use in calculations.

   Finally, we can run the dashboard node to see all the calculations at once as tables below. 

   We have explained the workflow details, but only manuel job is entering the dates just once. After that you can run the workflow and it will create the tables for you.  



If you liked this project, please don't forget to share and leave a comment below! 



Share:

Popular Posts