Custom Fields
Custom fields allow admins and contributors to expand the data model by creating fields from existing source columns.
Creating custom fields can provide flexibility and adaptability for specific business calculations. Custom fields allow for new fields to be created to expand on the data fields provided.
When to Use Custom Fields?
Use custom fields when you need to add a field that does not exist in the source schema, but would be beneficial to have in the semantic layer to streamline insight generation.
Create a Custom Field
Let's walkthrough an example of how to use custom fields to convert the format of a "YYYY-MM-DD" date field into a fiscal-year-week field.
Identify the Source Name of the Field
Use the source name for each of the fields involved in the custom calculation.
Note: it is only possible to use the source name of the field in the db.table in the actual calculation
Add a Custom Field
To add a custom field, edit the knowledge base and add a field.
Select Custom Field
Select the custom field to open the creation menu.
Input SQL Calculation into Custom Calculation Field
Use the source name for each of the fields involved in the custom calculation. Make sure to use the correct SQL dialect that matches the data source you connected.
to_char(actual_payment_date, 'IYYY-IW')
Add a semantic name and context for the field and press done.
Validate Custom Calculation Field
The custom field is now available to be used in generating insights.
Last updated