Examples
Custom Dimension
Creating a Custom Field
There are a few ways to create a new Custom Field. Once saved, the Custom Field will become available in the field picker.- Fields can be created from field picker, using the â+ Add Fieldâ menu at the bottom of the field list. Field can also be adjusted by right-clicking on any existing field and selecting âEdit.â

- Right click on any existing dimension and choose an aggregation (e.g. count distinct, sum, average, min, max). This will automatically create a new custom measure that appears in the field picker.

- Fields can be added from parsed SQL. When queries are run in SQL, Omni will extract valid snippets into associated potential dimensions. Theyâll be show in a special section at the top of the field picker. To add these fields to the workbook, select âAdd to Workbookâ from the Query Fields section:

Custom Field Syntax
You can think of a Custom Field as a snippet of SQL logic that gets injected into the generated SQL query whenever the field is brought into the analysis plane. To create one, simply write a snippet of SQL inside the editor. Optionally, you can leverage the substitution operator,${view.field}, to reference other fields. The substitution operator makes code more reusable and modular, enabling you to reference other objects. Itâs particularly beneficial when you want to chain together logic. For example, if you previously created a different custom field, you can reference it without having to repeat the calculation again. And, if in the future you change the definition for that field, the change will propagate to everything else that relies on it.
When you add the custom field to a query, you can see the logic applied in the SQL block.
