Data types and measures
This reference article provides information about the data types and measures used in data harmonization.
Data types used in data harmonization
Equivalence between Adverity and SQLAchemy data types
The table below provides information about the most common data types in Adverity and their equivalents in SQLAlchemy. For more information, see the SQLAchemy documentation.
Adverity |
SQLAlchemy |
Notes |
---|---|---|
String |
Unicode |
Adverity applies the maximum character length specified in the Length field. |
JSON |
String |
|
Long |
BigInteger |
|
Float |
Numeric |
Adverity uses a numeric precision is 13, and a scale of 4. |
Date |
Date |
|
DateTime |
DateTime |
For the Snowflake destination, Adverity uses the data type |
Boolean |
Boolean |
|
Percentage |
Float |
|
Currency |
Float |
|
Formula |
String |
|
These data types may be displayed differently in the destination depending on the data types the underlying database supports.
Universal data types
The table below provides information about the data types in Adverity that are universally used in data management.
Data type |
Notes |
Example |
---|---|---|
String |
Use for dimensions, such as names, titles, and descriptors. |
EN_Campaign_21 |
Long |
Use for integer metrics without decimal points. |
16 |
Float |
Use for non-integer metrics with digits after a decimal point. |
16.523 |
Date |
Use for dates. Adverity recognizes common date formats. (Recommended) Use the ISO 8601 format |
2021-03-11 |
DateTime |
Use for date and time. Adverity recognizes common datetime formats. (Recommended) Use the ISO 8601 format |
2021-03-11T16:23 |
Boolean |
Use for binary metrics. The values are either 0 (false) or 1 (true). |
0 or 1 |
Adverity-specific data types
The table below provides information about the data types that are specific to Adverity.
Data type |
Notes |
Example |
---|---|---|
Percentage |
Use for rates and percentages. Adverity automatically multiplies the values by 100. For example, 0.1 is displayed as 10 %. |
0.1 |
Currency |
Use for metrics that express values in a currency. |
10 |
JSON |
Use for layered metrics with JSON-compatible formatting. |
{"firstName": "Jane", "lastName": "Doe"} |
Formula |
Use to send information about formulas to the Google Sheets destination. |
=A1 + B1 |
Duration |
Use for metrics that express a time duration. (Recommended) Use the ISO 8601 format |
P2DT3H |
Measures used in data harmonization
The table below provides information about measure types, the mathematical function underlying the values in a metric field.
Measure type |
Notes |
---|---|
Sum |
Use for metrics that display the sum of values. Applicable for most metrics with values that can be summed up across several data sets, such as clicks, impressions. |
Average |
Use for metrics that display the average of values by dividing the sum of values by the number of data sets. |
Count |
Use for metrics that display the number of data sets. |
Min |
Use for metrics that display the minimum value across all data sets. |
Max |
Use for metrics that display the maximum value across all data sets. |
None (Metric) |
Use for metrics that do not have an underlying mathematical function, such as campaign reach. |
None (Dimension) |
If you store data in Adverity Data Storage, Adverity treats the data type of a field that you set up with this measure as a String regardless of the data type you select in the Type field. |
Specifying Data Mapping to store data in Adverity Data Storage
To store data from a datastream in Adverity Data Storage, ensure that all of the following conditions are satisfied:
-
Make sure the length of each field name in the data extract is no longer than 60 characters.
-
Make sure the length of each dimension value in the data extract is no longer than 2,700 characters.
-
In Data Mapping, perform the following actions:
-
Map at least one dimension to a target field.
-
Map at least one metric to a target field.
-
Troubleshooting: Mapped a field to the wrong data type and transferred it to Adverity Data Storage
If you accidentally map a source field to a target field of the wrong data type (metric instead of dimension or vice versa) and store the data in Adverity Data Storage, you cannot solve this issue by simply changing the data type of the target field.
To resolve this problem, follow these steps:
-
Create a new target field with the correct data type and with a different name.