ThingWorx Analytics Data > Prepare Data and Metadata
  
Prepare Data and Metadata
Preparing data for ThingWorx Analytics includes both a CSV file containing the raw data and a JSON file defining the metadata structure of the data.
Data
Keep in mind the following when preparing data for upload:
For any CSV file that includes headers, make sure there are no spaces before or after the column header names.
For time series data, temporal and entity ID columns must be included. In addition, ensure that data is streamed such that the timestamps increase in regular increments and any gaps that exist are generally incidental and small. To view a sample of time series data, see this Sample Time Series CSV File.
Metadata
The JSON format for the metadata file is outlined in the following chart. Links to metadata samples follow the chart.
* 
Optional parameters can be set to null or omitted (both will have the same effect).
Parameter
Description
Required/Optional
fieldName
The exact name of the field as it appears in the dataset.
Required
values
A list of the acceptable values for the field.
* 
For Ordinal opTypes, the values must be presented in the correct order.
Required if the opType is Ordinal
Optional for Categorical opType
Do not use for Boolean and Continuous
range
For a Continuous field, defines the minimum and maximum values the field can accept. For informational purposes only.
Optional
dataType
Describes what type of data the field contains. Options include: STRING, DOUBLE, BOOLEAN, INTEGER.
These options must be entered as all uppercase values. Lowercase values will lead to errors.
* 
Select the most accurate dataType. Selecting the String dataType for numeric data can lead to undesirable results.
Selecting the Integer dataType for a Continuous goal does not indicate that the scores output during Training will also be integers. Because the validation process cannot accept integers, the dataType for Continuous goals is converted internally from Integer to Double. In the resulting PMML output, scores are reported as more accurate floating point numbers.
Required
opType
Describes how the data in the field can be used. Options include: CONTINUOUS, CATEGORICAL, ORDINAL, BOOLEAN, TEMPORAL, ENTITY_ID.
These options must be entered as all uppercase values. Lowercase values will lead to errors.
Required
timeSamplingInterval
An integer representing the time between observations in a temporal field.
Required if the opType is Temporal
Do not use for other opTypes
isStatic
A flag indicating whether or not the value in a temporal field can change over time. Marking a field as static reduces training time by removing redundant data points for fields that do not change.
Optional
To view metadata samples, see the following:
Non-time series metadata sample
Time series metadata sample