--- title: "CombinedIndex" slug: "combinedindex" updated: 2022-02-09T19:19:13Z published: 2022-02-09T19:19:13Z canonical: "docs.datajet.app/combinedindex" --- > ## 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. # CombinedIndex ## General: CombinedIndex ## Create a new discrete integer field by multiplexing the unique values for fields 1 up to 6. All unique Value|value… combinations for the source fields are combined as strings and then the resulting values are assigned a unique integer. This creates a numerical field from 1 to N where N is the number of unique value|value… combinations from the combined source fields (sometimes referred to as the dimensional space). ## Purpose Use this function to: - Build unique keys for creating joins - Enumerate value|value combinations across multiple fields - Calculate dimensional space for multiple fields ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low / Med / High | | **DataType** | Discrete | | **DataSize** | Byte / Short / Integer | ```shell Example Return Value: 0......N where N is number of unique Value | Value combinations ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/Gen_CombIndex_Sample(2).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** | “p1”: “CombinedIndex” | CombinedIndex | | **Fields [1-6]** | “p1”: “Field1Name” … “p6”: “Field6Name” | At least 1 field is required *Supports:* - **DataType:** Discrete - **Field Type:** All discrete Field Types are supported. - **Fixed Value:** If a continuous key field needs to be used in a combined index, first transform the key field using the STRING \| CONCAT function. | | **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. If selected/true, then null values in Fields1-6 will be included in the value\|value combinations e.g. `Field1value\|Field2null` or `Field1null\|Field2value` will be included in the first stage string combination. | ## JSON Sample ```json { "method": "BuildBakedField", "project": "D3", "targetTable": "transactions", "overwrite": true, "name": "index-date-product", "function": "combinedindex", "p1": "date", "p2": "product" } ``` **Usage Notes** It is possible for the combination of values for the specified fields to exceed the maximum calculation size for the function. If this happens, use CombinedIndex more than once in order to create the required result See Also: - Engineering | Expression Field - CombinedDimension  (General Function) - CombinedDimensionNS (General Function) - CompositeLongKey (General Function) ## Example | Example | Details | | --- | --- | | **Description** | Create an index field from product and date | | **Input** | - Table: = [transactions] - Filter: = [No Filter] - **Function: = CombinedIndex** - Field 1:= [transactions].[product] - Field 2:= [transactions].[date] - Name: =index-date-product | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/Gen_CombIndex_Example(2).png) |