Defining Aggregates Yourself
You can define your own aggregates for use cases that fall outside of those covered by system-defined aggregates.
Prerequisites
Before defining aggregates for your models, you should familiarize yourself with the following sections:
-
If your aggregate definition will use one or more joins to dimensional datasets and the aggregate is allowed to be built with incremental builds, follow these steps before creating the aggregate:
- Read the section Incremental rebuilds of aggregates that use joins in to ensure that you are aware of the special considerations for such aggregates.
- In Design Center, edit the fact dataset's underlying SML to
include the
incremental
property. For more information, see About Incremental Rebuilds and the AtScale SML Object Documentation on GitHub.
-
If you want instances of your aggregate definition to be partitioned:
- Verify that the
TABLES.CREATE.PARTITIONS.ENABLED
andAGGREGATES.CREATE.PARTITION.USERDEFINEDAGGREGATE.ENABLED
global settings are both enabled, as described in Global Settings for User-Defined Aggregates Only. - Set a partition key for the aggregate definition. For instructions, see Partitioned User-Defined Aggregates.
- Verify that the
Defining aggregates for a model
To define aggregates for a model, you must edit the model file's
underlying SML to include the aggregates
proprty. For more
information, see
the AtScale SML Object Documentation on GitHub.
What to do next
The user-defined aggregate table is created the next time the model is deployed. You can check the status of the aggregate creation on the Aggregates page.