- 1 Minute to read
- Print
- DarkLight
- PDF
CombinedIndex
- 1 Minute to read
- Print
- DarkLight
- PDF
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
- 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 |
Example Return Value: 0......N where N is number of unique Value | Value combinations
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:
|
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.
|
JSON Sample
{
"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 |
|
Sample |