ICAST
- 1 Minute to read
- Print
- DarkLight
- PDF
ICAST
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
String: ICAST
Extract numeric data contained in a string and store as a numeric integer
Converts a DISCRETE or CONTINUOUS STRING field into an INTEGER field. The string must be an exact integer or it will be cast as NULL.
Purpose
Use this function to:
- Force a string to be numeric
- Filter records containing non-numeric data
Return Value
Property | Value |
---|---|
FieldType | Integer |
FieldSize | Low / Med / High / Continuous |
DataType | Discrete / Continuous |
DataSize | Short / Integer / LongInteger / Double |
Example Return Value: 321565
Parameters
Parameter | JSON | Description |
---|---|---|
Table | “targetTable”: “MyTableName” | The target table on which the new field will be created |
Filter | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter recordset will be returned as null. |
Function | "function":"" | String |
String Function | “p1”: “ICAST(A)” | ICAST(A) |
A | “p2”: | Required. The source field from which to extract the numeric data. Supports:
|
Treat Null as Zero | "nullIsZero": true "nullIsZero": false | True/False. Default = False If true, then any null values in the input fields will be treated as if they have a value of 0. |
JSON Sample
{
"method": "BuildBakedField",
"project": "BikeData2",
"targetTable": "Journeys",
"overwrite": true,
"name": "start_station_id_only",
"function": "string",
"p1": "ICAST(A)",
"p2": "start_station_raw"
}
Usage Notes
See Also:
- Engineering | Expression Field
Example
Example | Details |
---|---|
Description | Extract Numeric fields from a mixed string |
Input |
|
Sample |
Was this article helpful?