You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
close
You are viewing the article in preview mode. It is not live at the moment.
Home > Transformations > Transformation Definition - Round Time Rule
Transformation Definition - Round Time Rule
print icon

This article will guide you through understanding and setting up Rounding Rules in detamoov, focusing on creating File Definitions that accurately match your input file format. We will cover how to define the Fields, Type, Pattern and how to Transform the file using the Rounding Rules effectively.


Step 1: Create the File Definition - Understanding the Input File Structure

When dealing with input files in detamoov, the first step is to create a File Definition that matches the structure of your file. This involves specifying the names, types, and patterns of the fields. Here, we'll discuss roundingTime Only and provide a detailed example.

1. Time Only Field

  • Field Name: Time Only
  • Field Type: DATE
  • Pattern: hh:mm:ss tt
  • Explanation: This pattern captures the time in hours, minutes, and seconds, followed by AM/PM notation. For example, 08:30:01 AM.

If you haven't already created a File Definition, please refer to the How to create a new File Definition article.

Step 2: Transformation Definition – Configuring the Rounding Rule

If you haven't already created a Transformation Definition, please refer to the How to create a new transformation article.

Once your input file structure is defined correctly, the next step is to configure the Transformation Definition for the Round Time rule. Rounding Rules in detamoov allow you to define how time entries are rounded up or down.

Key Components of Round Time:

  1. Round Time Options:
    • Up: To the minute > any seconds round up.
    • Down: To the minute > any seconds round down

To verify the accuracy of your Round Time rule, preview the file definition. This step allows you to see a sample of the transformed data and confirm the expected output results.  To preview the Transformation Definition, hover over the row of your transformation and click on the magnifying glass  icon.

Example Test Scenario: Rounding Time Values Up and Down

Scenario Description:
Given the following time values in the input file, the transformation will apply the following rounding rules:

  • Round Up: Rounds time to the nearest minute, rounding up if there are any seconds.
  • Round Down: Rounds time to the nearest minute, rounding down if there are any seconds.

Input File Time Only Values:

  1. 12:14:59 AM
  2. 11:59:59 PM

Expected Output Results: The screenshot below displays the results of Expected Output Results using the Transformation preview.

  • For 12:14:59 AM:
    • Round Up Result: 12:15:00 AM
    • Round Down Result: 12:14:00 AM
  • For 11:59:59 PM:
    • Round Up Result: 12:00:00 AM (Midnight of the next day)
    • Round Down Result: 11:59:00 PM

By following the steps above, you can effectively configure your File Definitions and Transformation Definition Round Time Rule in detamoov for time and date conversions. Make sure that your input file is structured correctly to match your File Definition, and carefully define your Rounding Rules to meet your business needs.


Implementing Rounding Rules for supported Field Types

To configure the Round Time rule effectively, it’s crucial to understand the supported field types and formats.

The Round Time rule can be used with the following supported field types:

  • Date: Represents a calendar date, typically including the year, month, and day.
  • Time: Represents a specific time of day, usually including hours, minutes, and seconds.
  • Date-time: A combined field that represents both date and time in a single value.

Supported Field Formats

Time Formats:

  • HH:MM (24-hour format): Example: 15:49:22
  • hh:mm AM/PM (12-hour format): Example: 3:49:22 PM

 

Date Formats

  • YYYY-MM-DD (ISO 8601 format): Example: 2024-08-23
  • MM/DD/YYYY (Common US format): Example: 08/23/2024
  • DD/MM/YYYY (Common European format): Example: 23/08/2024

 

Combined Date and Time Format:

  • M/d/yyyy hh:mm tt: Example: 8/23/2024 3:49:22 PM
    • M: Month (e.g., 01 for January)
    • d: Day of the month (e.g., 01 for the first day)
    • hh: Hours (12-hour format, without leading zeros)
    • mm: Minutes (e.g., 00 for 0 minutes)
    • ss: Seconds (e.g., 00 for 0 seconds)
    • tt: AM or PM indicator

 

Understanding these field types and formats will help you effectively use the Round Time rule to achieve the desired transformation for date and time values in your data.

 

This is a basic overview of commonly used date and time formats. Other variations may exist based on preferences and specific use cases.

 

Need a quick overview of time and date-time formats in detamoov? Check out our Time and Date Formats: A Quick Reference Guide for a comprehensive list. 

 

 

scroll to top icon