--- title: "CombinedDimension" slug: "combineddimension" updated: 2022-02-10T19:10:34Z published: 2022-02-10T19:10:34Z canonical: "docs.datajet.app/combineddimension" --- > ## 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. # CombinedDimension ## General Functions: CombinedDimension ## Create a new discrete string field by joining up to 6 discrete fields together. Field Values are separated with underscores.. ## Purpose Use this function to: - Build unique keys for creating joins - Create an input field for performing a FirstDiscrete on one or more fields ## Return Value | **FieldType** | String | | --- | --- | | **FieldSize** | Low - Med - High | | **DataType** | Discrete | | **DataSize** | Byte / Short / Integer | `[field1Value]_[field2value]` e.g. `clothes_2020-01-12` ## Parameters | **Component** | **JSON** | **Description** | | --- | --- | --- | | #### **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. Must come from target table. Records not in the filter will have a null value in the resulting field. | | #### **Fields [1-6]** | “p1”: “Field1Name” … “p6”: “Field6Name” | All fields must come from target table. All discrete Field Types are supported. At least 1 field must be specified If a continuous key field needs to be used in a combined dimension, first transform the key field using the CONCAT function. | | #### Include Null | “includeNull”: | If selected/true, then any null values in Fields1-6 will be included and denoted using null. e.g. `clothes_null` or `null_2019-0101` | ## JSON sample ```json { "method": "BuildBakedField", "project": "D3", "targetTable": "transactions", "overwrite": true, "name": "key-date2", "function": "combineddimension", "includeNull": true, "p1": "date", "p2": "product", "dataSet": { "logic": "or", "name": "yearqtr_20191", "strict": true, "set": [ { "logic": "and", "stype": "FIELD", "entity": { "type": "field", "name": "transactions.yearqtr", "table": "transactions", "valueFilter": [] }, "op": "=", "values": [ "20191" ] } ] } } ``` **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 CombinedDimension more than once in order to create the required result ## Example | ### Create product-date key field | | --- | | - Table: = Transactions - Function: = CombinedDimension - Filter:= [No Filter] - Field 1: = product - Field 2: = date - Include Null = False - Name = product-date | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1634108807551.png) | | ### Create product-date key field - include nulls | | - Table: = Transactions - Function: = CombinedDimension - Filter:= [No Filter] - Field 1: = product - Field 2: = copy_date_2020 - **Include Null = True** - Name = product-date | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1634108807582.png) | | ### Create product-date key field for 2020 only | | --- | | - Table: = Transactions - Function: = CombinedDimension - **Filter:= [Year=2020]** - Field 1: = product - Field 2: = copy_date_2020 - Include Null = False - Name = product-date | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1634108807612.png) |