This guide aims at providing the basic configuration tips to start defining levels with the fluent builder.Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Hierarchies categorize data into levels for aggregation and visualization. For more info about hierarchies, see here.- The levels in a hierarchy are organized with parent-child relationships.
- All non-slicing hierarchies have a parent level, called “AllMember”, to aggregate data across all members of all levels. It is created and configured automatically.
- The level is often based on a column of the database from which they inherit a data type, a formatter and a comparator.
Basic configuration
For a hierarchy, use:withDimension("dimensionName")to define the dimensionwithHierarchy("hierarchy)to define a hierarchywithLevel("levelName")to define the levels.
Here the order is important : the level “year” is defined first so it will be the parent of the level “month”.
withSingleLevelDimension("dimensionName"):
- Create a level with a different name to the selection field
- Create a level that is based on a specific selection field (i.e. not the first reachable field with the same name as the level)
Defining the time levels
Level types
There are mainly three level types:ALLthe type of the “AllMember” level that exists as the first level of all non-slicing hierarchiesTIMEfor time levels (with specific subtypes for the different time units)REGULARfor the other levels (it is the type defined by default).
The level type is different from the data type of the selection field the level is based on. The data type is the type
of the members of the level: double, string, date…
withLevelType(ILevelInfo.LevelType.TIME) to define the type of the levels representing time so that they are
correctly handled by time measures (for example, finding the first month of a quarter).
Formatter
By default, each data type has a formatter to define how to display the level members:- add a comma to group thousands in numbers
- format dates
Ordering level members
By default, members of a hierarchy are ordered:- Alphanumerically for data with type string
- Chronologically for dates
- the order in which the members are displayed on the dashboard.
- the level member selected for some commutations (such as lag and lead measures).
First objects
To fix the first objects so they always appear on top, usewithFirstObjects:
Custom comparator
To define the comparator of a specific level, usewithComparator(key) where key is one of the following:
- the plugin key of a built-in comparator provided by Atoti Server, see constants defined in
IComparator. - the plugin key of a custom comparator implementation.
IComparator interface which wraps a java.util.Comparator into a plugin
value for easier configuration.
Custom comparators are typically defined as follows: