16/02/2023
❇️ ❇️ Change data type In ZOHO DATA PREPARATION ❇️ ❇️
Zoho DataPrep automatically identifies the data type of each column in your dataset during the time of import.
Sometimes due to multiple errors in the dataset, DataPrep may not correctly identify the data type, in which case you can manually override to change the data type of the column using the Change data type transform.
🔶To change the data type of a column
1. Right-click the column name and select the Change data type option from the context menu.
2. The Select datatype dropdown in the Studio panel shows a list of datatypes with match accuracy.
Match accuracy is the percentage of data volume in the selected column that conforms to a data type.
3. DataPrep supports the following data types:
• Text
• Number
• Decimal
• Timestamp
• Positive number
• Date
• Date time
• Time
• Duration
• Currency
• Length
• Temperature
• Boolean
• Email
• URL
• List
• Map
• Percentage
4 . After selecting the datatype, choose the desired format from the available options. Click here to know more about the format options.
Zoho DataPrep uses the format specified by the user to identify
if the column data conforms to the data format specified and marks the column data as valid or invalid.
5. Enable the Add constraints toggle to set constraints and determine valid values in a column. The values that do not follow the constraints you have set will be categorised as invalid values in the column. However, they will not be removed. Click here to know more about constraints.
6. If you want to set a column as mandatory, y ou can select the Set as mandatory (not null) checkbox.
7. You can also apply this transform along with constraints on multiple columns. Select the required columns using the icon under Columns to apply .
8. Choose a datatype from the listed types and click Apply .
9. You can also create your own data type by choosing Create custom data type option.
🔶To add a constraint
1. Enable the Add constraints toggle.
2. Select an option from the constraints section and enter the string. The options are displayed based on the data type of the first column you have selected in the Columns to apply field.
3. When you add more than one constraint, the logical operators, AND or OR appear next to the constraints. You can click to toggle the logical operator between AND and OR.
🔶Criteria expression
Using the logical operators, you can combine the constraints and apply logic to determine the rule of precedence. The final expression is displayed in the Criteria expression box. You can click Edit to alter the default expression using logical operators and parenthesis to specify the precedence or the sequential order as to which constraint should be evaluated first. Click Save after making the required changes.
4. Click Apply .
🔶If you select the Date, Datetime or Time types
You can select the required tiles and construct the Date, Datetime or the Time format.
1. Click to select the different date and time components to build your custom format.
2. You can choose the 24-Hour format by selecting the hour-format icon which would appear at the right end when you hover your mouse over the text box.
3. You can click on the grip portion of the tile (grip icon that appears on hovering your mouse over) and move around the tiles to rearrange them.
4. A live preview of your date, datetime or a time column is shown as you build your format.
The date, datetime or the time format constructed is invalid if one or more of the following conditions are not met:
• You have to choose at least one tile from the Day, Month, and Year tiles.
• You can use the characters, 'Z' and 'T' only once in a datetime and a time format.
• The tiles that follow the character, 'T' must be related to time such as Hours, Mins, Sec.
• A datetime and time format must contain an Hours tile.
• In a datetime format, you can use either the character, 'Z ' or any one of the T.zone tiles.
• You can use any one of the T.zone tiles in a time format.
• You can choose only one format from the Day, Month, Year, Hours, Mins, and Sec tiles.
DataPrep allows only the following delimiters while constructing a date or a date-time format.
Date and Datetime delimiters
/ : - , . \s T Z
Time delimiters
/ : - , . \s Z