Icon

Date & time operations

<p><strong>Date&amp;Time Operations: Customer Purchase Analysis</strong></p><p>Working with date &amp; time values can be tricky. KNIME offers a variety of nodes for date-&amp; time-related operations. To make use of these nodes, it is crucial to transform the relevant columns into <em>Date&amp;Time</em> cells.</p><p>Based on a customer purchase analysis use case, this example workflow demonstrates how to how to convert a date &amp; time value from <em>String </em>into <em>Date&amp;Time</em> and illustrates how different date &amp; time operations can be performed. After processing the transaction data, the workflow identifies each customer's potential churn risk based on a their inactivity.</p><p>The sample data has 5 columns:</p><ul><li><p>Customer ID: Each customer's identification number</p></li><li><p>Purchase Date: The date and timestamp when each purchase was made</p></li><li><p>Purchase Amount: The purchase amount</p></li><li><p>Store Location: The location of the store where the purchase was made</p></li><li><p>Product Category: The product category</p></li></ul>

URL: KNIME Blog: Explore Date&Time in KNIME & Get Best Practices https://www.knime.com/blog/explore-date-time-formats-best-practices
URL: KNIMETV: Handling Date & Time Data with KNIME: Convert Strings and Extract Date & Time Fields https://youtu.be/3qtKNSeGbms?si=5anbUCrGMbLT90Gc
URL: KNIMETV: Handling Date&Time Data with KNIME: Modify and Filter Date&Time Data https://youtu.be/xdH31vqKGX4?si=7fdqGi4V5eLMaxJX

Date & time operations: Customer purchase analysis


Working with date & time values can be tricky. KNIME offers a variety of nodes for date-& time-related operations. To make use of these nodes, it is crucial to transform the relevant columns into Date&Time cells.

Based on a customer purchase analysis use case, this example workflow demonstrates how to how to convert a date & time value from String into Date&Time and illustrates how different date & time operations can be performed. After processing the transaction data, the workflow identifies each customer's potential churn risk based on a their inactivity.

The sample data has 5 columns:

  • Customer ID: Each customer's identification number

  • Purchase Date: The date and timestamp when each purchase was made

  • Purchase Amount: The purchase amount

  • Store Location: The location of the store where the purchase was made

  • Product Category: The product category

Step 1

Step 2

Step 3

Step 4

Step 5

Read data

Step 6

Step 7

Step 8

Step 9

Convert Purchase Dateto date&time
String to Date&Time
Group: Customer ID &Store Location
Group Loop Start
Difference toprevious purchase (days)
Date&Time Difference
Shift Purchase Date7 days back
Date Shifter
Extract Year,Month & Day of Week
Date&Time Part Extractor
Add time zonebased on Store Location
Time Zone Modifier
Get churn risk
Expression
Get last purchasefor each customer
GroupBy
Difference totoday (=2025-10-31)
Date&Time Difference
Date&Time-based Row Filter
Loop End
Read customertransaction data
CSV Reader

Nodes

Extensions

Links