--- title: "ICAST" slug: "icast" updated: 2023-03-24T13:54:41Z published: 2023-03-24T13:54:41Z canonical: "docs.datajet.app/icast" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # ICAST ## 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 | ```shell Example Return Value: 321565 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1679665965988.png) ## 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:* - **DataType:** Discrete / Continuous - **Field Type:** String - **Fixed Value:** "NNaANNuu" | | **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 ```json { "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** | - Table: = [journeys] - Filter: = [No Filter] - **Function: = String** - String Function:= ICAST(A) - A:=[journeys].[start_station_raw] - Name: = start_station_id_only | | **Sample** | |