Define and Use an 'Other' Dimension Value
You may want to define a Dimension that enumerates only a limited set of the available values, with the rest of the values grouped under a catch-all 'Other' Dimension value. For example, you may have three key products that make up most of your business, while the rest of the products can be collapsed into a single dimension. You can do this in Metric Insights by writing a fetch command for your Dimension that creates this grouping.
This article shows you how to create, then use this Dimension when defining Metrics and Reports. In this example, we define a Product Dimension and select three specific products for Dimension values while assigning the rest of the products to an 'Other' Dimension value.
1. Access Content > Dimensions
At the bottom of the screen click [+ New Dimension].
The Add Dimension pop-up opens.
1.1. Complete the fields essential for creating a new Dimension
- This example uses SQL as a Value Source.
- Bind parameter: Setting this to match the column name for the data in the source system makes writing fetch commands for Dimensioned element easier
- Save to proceed with creating a new Dimension. Once Saved, the Dimension Editor opens.
2. Create your Fetch command
- Note how the CASE statements are used to surface the three desired products and to bucket the rest of the product into the "OTHER" Dimension with a key value of -1.
- The first CASE statement maps all product_id values to "-1" except for 9, 10, and 50.
- The second CASE statement selects the product names for the three products with product_id of 9, 10, and 50 and groups the rest of the products under "OTHER".
- Validate your Statement
2.1. Collect Dimension Values
- If your statement is valid, the statement box is green; if there are any errors, the box is colored in red and errors will be explained in the field below.
- Examples of data records are displayed below the SQL statement. Confirm that sample values shown in post-validation are the ones you have expected.
- If the values returned Collect Data
2.2. Dimension Values Grid will be populated
3. Write Element Data Fetch Commands for 'OTHER' Mapping
When writing a fetch command for a Metric or Report that uses this Dimension, include the same CASE statement logic used to select the key value for the Product Dimension.