Curious Minds

Clear answers to science and history questions

How to Import Time Column to JMP: Step-by-Step Guide

· 5 min read · Science

Importing a time column into JMP correctly ensures that your data is recognized as temporal rather than categorical or numeric, allowing for accurate trend analysis and forecasting. The primary goal is to convert raw text strings representing times (such as "14:30:05" or "2:30 PM") into JMP's native time format. This conversion enables you to perform calculations like duration differences, sort chronologically without errors, and create time-series plots where the x-axis scales linearly with actual elapsed time. Before beginning, ensure your source file (CSV, Excel, or text) is closed in other applications to prevent lock conflicts during import.

What You'll Need

  • JMP software installed on your computer.
  • A data file containing a column with time values in text format.
  • Basic knowledge of the time format used in your data (e.g., HH:MM:SS, AM/PM).

Step-by-Step

  1. Open the Data File: Launch JMP and navigate to File > Open. Select your data file. In the import dialog, ensure the preview shows the time column as it appears in the source. If the data is in Excel, make sure the sheet is selected correctly. Click OK to load the data table.
  2. Check Current Column Type: Look at the column header for your time data. If it displays a red triangle with an icon indicating "Character" or "Nominal," JMP has imported it as text. This is expected if the original cells were formatted as text or contained mixed formats. Do not attempt to change this directly in the script editor yet; use the graphical interface for clarity.
  3. Access Column Properties: Right-click the column header of the time variable. From the context menu, select Column Info. A window will appear showing details about the current column, including its data type and modeling type.
  4. Change Modeling Type to Time: In the Column Info window, locate the Modeling Type dropdown menu. Change this from Nominal or Ordinal to Time. Note that simply changing the modeling type might not parse the string if the format is non-standard. For robust parsing, proceed to the next step if the values do not automatically update to show clock icons.
  5. Use Formula Editor for Parsing (If Needed): If changing the modeling type leaves the values blank or incorrect, right-click the column header again and choose Formula. In the formula editor, you can use functions like Parse Date Time or Time. For example, if your format is "HH:MM:SS", you might enter a formula such as Parse Date Time(:TimeColumn, "%H:%M:%S"). Replace :TimeColumn with the actual name of your source column. Ensure the result column is set to Time modeling type.
  6. Verify the Conversion: Close the formula editor. The column header should now display a clock icon, indicating it is a Time column. Check several rows to ensure the values are displayed correctly (e.g., 14:30:05 instead of a serial number or text). You can also check the Summary platform by going to Analyze > Distribution and selecting the new time column to see if the histogram reflects time intervals.
  7. Save Your Work: Once verified, save the data table using File > Save As to preserve the new column properties. If you used a formula, consider creating a static copy by right-clicking the column and selecting Recode > Create Static Copy if you no longer need the link to the original text column.

Common Mistakes

One frequent error is assuming that changing the "Data Type" to "Numeric" will handle time. While time is internally stored as seconds since midnight, treating it as generic numeric data loses the formatting benefits and makes sorting difficult (e.g., 9:00 AM appearing after 10:00 AM if sorted alphabetically). Another common mistake is ignoring inconsistent formats within the same column. If some entries are "2:30 PM" and others are "14:30", JMP may fail to parse them uniformly unless you clean the data first. Additionally, users often forget to close the Excel file before importing, leading to permission errors or stale data being loaded.

Tips

Before importing, standardize your time formats in the source file if possible. Using ISO 8601 format (YYYY-MM-DDTHH:MM:SS) is generally the most reliable for automated parsing across different software. When using the Parse Date Time function, remember that case sensitivity matters for AM/PM indicators; ensure your format string matches the data exactly (e.g., use "%p" for AM/PM). If you have a large dataset, test the parsing formula on a small subset first to avoid long processing times if the syntax is incorrect. Finally, keep the original text column until you are fully confident in the new Time column, then delete it to reduce file size.

Troubleshooting

If the time column remains blank after applying the formula, check for hidden spaces or special characters in the source text. Use the Trim Whitespace function in the formula editor to clean the input string before parsing. If the values appear as negative numbers or extremely large integers, the date portion might be missing or incorrectly interpreted; ensure you are only parsing time if the date is constant, or include the date component in the format string. If JMP crashes or hangs during import, try opening the file in a plain text editor to verify there are no corrupt lines or encoding issues (switch from UTF-8 to ANSI if necessary). Verify that the column name in your formula exactly matches the column header in the data table, including any spaces or special characters.

Frequently Asked Questions

Can I import time zones?

JMP does not natively support complex time zone conversions within a single time column. It is best practice to convert all times to UTC (Coordinated Universal Time) before importing them into JMP to maintain consistency across datasets from different regions.

Why does my time column sort incorrectly?

This usually happens because the column is still typed as Character or Nominal. Even if it looks like time, JMP sorts character strings alphabetically. Ensure the Modeling Type is set to Time, which forces chronological sorting based on the underlying numeric value.

How do I calculate the difference between two time columns?

You can subtract one time column from another using the formula editor. The result will be a numeric value representing the difference in seconds. To display this as hours or minutes, divide the result by 3600 or 60 respectively, and format the resulting column as Numeric.

Does JMP support milliseconds?

Yes, JMP supports sub-second precision. When parsing, include the appropriate format specifier for milliseconds (often %f or similar depending on the specific parser version) in your Parse Date Time formula. Ensure your source data actually contains millisecond information.

Can I batch process multiple files?

Yes, you can write a JSL (JMP Scripting Language) script to loop through a folder of files, apply the time parsing logic, and save the processed tables. This is useful for large-scale data cleaning tasks where manual intervention is impractical.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions