clsTransformDateDifference Step

Use this feature to calculate the difference between two date values within an ETL dataset.

Last published at: July 21st, 2026

Description:

The Transform Date by Date Difference step calculates the elapsed time between two configured date values. The transformation is configured through the Configure Date Difference property, where ETL designers define the source date columns, the desired date interval (such as days, months, or years), and the destination column for the calculated result.

Business applications frequently require measuring elapsed time between important events. Examples include calculating customer account age, employee tenure, warranty periods, invoice aging, contract durations, project timelines, and order fulfillment cycles. This transformation provides a reusable mechanism for performing these calculations without requiring custom SQL expressions or scripting.

During ETL execution, the configured start and end dates are evaluated for each row. The calculated interval is written to the destination column and immediately becomes available to downstream ETL components.

Unlike Transform Date by Getting Working Days Between Two Dates, which measures only business working days, this transformation calculates the actual elapsed difference between two dates according to the configured interval.

The Transform Date by Date Difference step is commonly placed after data validation and before reporting, filtering, aggregation, exporting, or database loading.

The step supports:

  • Date difference calculations
  • Configurable interval units
  • Multiple date calculations
  • Duration analysis
  • Enterprise ETL workflows
  • Integration with FlowWright ETL pipelines

Typical business uses include:

  • Customer account age
  • Employee service duration
  • Invoice aging
  • Contract lifecycle reporting
  • Warranty period calculations
  • Project duration analysis
  • Business intelligence reporting

 

Inputs

  • Configure Date Difference – Configure one or more date difference calculations. Each configuration specifies the start date column, end date column, interval type, destination column, and calculation options used to determine the elapsed time between the two dates.
 

 

Returns

  • The Transform Date by Date Difference step does not define explicit return paths.

Note: After all configured date difference calculations have completed successfully, ETL processing automatically continues to the next connected component. Any configuration or execution errors are recorded in the ETL execution log.

 

 

Usage:

The Transform Date by Date Difference step is typically inserted after importing and validating date values but before reporting, grouping, filtering, exporting, or loading the transformed dataset into downstream systems.

During execution, the configured date columns are evaluated for every row. The calculated date difference is stored in the configured destination column, where it can be used by subsequent ETL transformations.

A typical ETL pipeline might look like this:

 

Typical usage scenarios include:

  • Calculating invoice aging in days
  • Measuring employee tenure in years
  • Determining contract duration
  • Tracking order fulfillment time
  • Calculating customer relationship length
  • Producing compliance reports
  • Building executive KPI dashboards

The calculated interval values can then be grouped, filtered, sorted, aggregated, exported, or loaded into downstream reporting and business systems.

 

Prerequisite:

The ETL process engine service should be running to execute the ETL definitions.

 

 

Example:

Let’s build and execute the “clsTransformDateDifferenceDef” example.          

  • Create a new ETL definition called “clsTransformDateDifferenceDef” and open the definition in designer mode. 
  • Drag “clsInputCSV, clsTransformDateDifference, and clsOutputCSV” steps to the canvas. 
  • Connect the dots between the “clsInputCSV” step and other steps, as shown above.
  • Define a variable or a global to hold the virtual path. 
  • Click the "clsInputCSV" step to configure its "Required" properties. Provide a name for the step. Specify the path to the input CSV file on the application server. Select the ETL data schema from the drop-down list. Note: The schema's column names should match those in the input file. Click the Save button. Click here to learn about the ETL Data Schema Designer.

 

  • Click the "clsInputCSV" step to view its "Optional" properties. Select the Show Schema button. The pop-up window displays the schema columns as shown below. This function helps to understand the schema at a glance. 

 

  • Click the "clsTransformDateDifference" step to configure its "Required" properties. Enter the step name. Click the button to configure the transform list. Then click the Save button. 

 

  • Click the "clsTransformDateDifference" step to configure the transform list. A pop-up window will appear. Click the Add Row (+) button to insert an empty row. Select the source date column from the drop-down list. Enter the date format. Select the target date column from the drop-down list. Click the Save button. Click the Add Row button to add multiple columns for transformation. 

 

  • Click the "clsOutputCSV" step to configure its "Required" properties. Enter a name for the step. Enter the path to the output CSV file on the application server. Click the Save button. 

 

  • Click the "clsOutputCSV" step to configure its "Optional" properties. Provide a name for the step. Provide a variable or global reference to store the virtual output path. Click the Save button. 

 

  • The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown below. Configure the “Logging” using the following properties.

 

  • Save the ETL definition, create a new ETL instance, and execute. Render the ETL instance. Click the ETL step to view its properties. The “clsTransformDateDifference” step should transform the dates from the input format to the desired output format for the file. The variable/global holds the output file’s virtual path, as shown below. 

 

Tips:

  • Validate all source date values before performing date difference calculations.
  • Ensure the selected interval (days, months, or years) aligns with business reporting requirements.
  • Preserve original date columns for auditing and historical analysis.
  • Standardize interval calculations across ETL definitions to ensure consistent reporting.
  • Test calculations using representative production datasets before deployment.
  • Review downstream reports whenever business rules for duration measurements change.
  • Combine this transform with Validate Data, Transform Date by Format, Transform Date by Extracting a Part, Transform Date by Getting Working Days Between Two Dates, Group By Transform, JSON Output File, or SQL Output components to build comprehensive date-processing workflows.

 

Notes:

  • Multiple date difference calculations can be configured within a single transformation.
  • Source columns must contain valid date values.
  • The original date values remain unchanged unless explicitly overwritten.
  • Calculated interval values immediately become available to downstream ETL components.
  • Invalid date values or incomplete mappings may result in ETL execution errors.
  • The exact interval calculation follows the configuration provided in the Configure Date Difference property and the FlowWright ETL engine's supported date interval calculations.
  • This transform is commonly used for HR reporting, SLA tracking, customer analytics, financial reporting, project management, ERP integrations, business intelligence, and enterprise compliance reporting.v

 

Transform Date by Date Difference vs. Transform Date by Getting Working Days Between Two Dates:

Although both transformations compare two date values, they are intended for different business scenarios:

Transform Date by Date Difference Transform Date by Getting Working Days Between Two Dates
Calculates the elapsed difference between two dates using the configured interval. Calculates the number of business working days between two dates.
Measures calendar-based durations such as days, months, or years. Measures business-day durations based on working-day rules.
Commonly used for age calculations, tenure, warranty periods, and contract durations. Commonly used for SLA monitoring, turnaround analysis, and operational performance reporting.
Example output: 365 days, 24 months, or 8 years. Example output: 252 working days.

As a general guideline:

  • Use Transform Date by Date Difference when calendar-based elapsed time is required.
  • Use Transform Date by Getting Working Days Between Two Dates when business-day calculations are required for operational or SLA reporting.

 

Definition Sample:

You may download the sample ETL definition(s) from the link provided and later import them into your FlowWright ETL Designer.

Note: Verify and complete any missing configuration after importing the sample, including:

  • Start and end date mappings
  • Interval selection
  • Destination column configuration
  • ETL schema validation
  • Downstream transformation mappings
  • Destination component configuration
  • Environment-specific settings

After verifying the configuration, save the ETL Definition before execution.

Click here to download the sample file.