Enum Class AggregationLevels

java.lang.Object
java.lang.Enum<AggregationLevels>
com.activeviam.activepivot.copper.api.AggregationLevels
All Implemented Interfaces:
Serializable, Comparable<AggregationLevels>, java.lang.constant.Constable

public enum AggregationLevels extends Enum<AggregationLevels>
Mask determining whether a CopperMeasureToAggregateAbove will be aggregated if any of the defined levels are present or if all are expressed.

An example would be the following : We have some simulation data generated along scenarios, where records are given both scenarionId and and a scenarioName :

 ┌─────────┬────────┬──────┐
 │ scenId  │ ScName │ data │
 ├─────────┼────────┼──────┤
 │       1 │ "A"    │  10. │
 │       1 │ "A"    │  10. │
 │       1 │ "A"    │  -5. │
 │       2 │ "B"    │  20. │
 │       2 │ "B"    │  -10 │
 └─────────┴────────┴──────┘
 

Let's consider the folLowing measure:

   Copper.sum("data")
   .per(Copper.Level("ScenId"),Copper.Level("ScName"))
   .doNotAggregateAbove(AggregationLevels mask)
 
The value of mask will determine up to which level data.SUM will be aggregated.
Author:
ActiveViam
  • Enum Constant Details

    • ANY

      public static final AggregationLevels ANY
      Property determining the aggregation behavior of the current measure as follows :

      The measure will be aggregated until one level from the list of requested CopperLevel in the previous CopperMeasure.per(CopperLevel...) call is expressed in the query.

      In other words, the aggregation will stop along a hierarchy when more than one level from both the latter hierarchy and the list of requested levels are present in the queried location.

      Considering the example from AggregationLevels

       Copper.sum("data")
                      .per(Copper.Level("ScenId"), Copper.Level("ScName"))
                      .doNotAggregateAbove(AggregationLevels.ANY)
       
      will be not be aggregated at the expressed location if ANY of the hierarchies is queried above the levels defined in the per() call:
       ┌─────────┬────────┬──────────┐
       │ scenId  │ ScName │ data.SUM │
       ├─────────┼────────┼──────────┤
       │ (ALL)   │        │          │
       │         │    "A" │      15. │
       │         │    "B" │      10. │
       │    1    │ (ALL)  │          │
       │         │    "A" │      15. │
       │         │    "B" │      10. │
       │    2    │ (ALL)  │          │
       │         │    "A" │      15. │
       │         │    "B" │      10. │
       └─────────┴────────┴──────────┘
       
    • ALL

      public static final AggregationLevels ALL
      Property determining the aggregation behaviour of the current measure as follows :

      The measure will be aggregated until all level from the list of requested CopperLevel in the previous CopperMeasure.per(CopperLevel...) call is expressed in the query.

      In other words, the aggregation will only stop along a hierarchy when all levels from both the latter hierarchy and the list of requested levels are present in the queried location.

      Considering the example from AggregationLevels

       Copper.sum("data")
                      .per(Copper.Level("ScenId"), Copper.Level("ScName"))
                      .doNotAggregateAbove(AggregationLevels.ALL)
       
      will be not be aggregated at the expressed location if ALL of the hierarchies are queried above the levels defined in the per() call:
       ┌─────────┬────────┬──────────┐
       │ scenId  │ ScName │ data.SUM │
       ├─────────┼────────┼──────────┤
       │ (ALL)   │        │          │
       │         │    "A" │      15. │
       │         │    "B" │      10. │
       │    1    │ (ALL)  │      15. │
       │         │    "A" │      15. │
       │         │    "B" │      10. │
       │    2    │ (ALL)  │      10. │
       │         │    "A" │      15. │
       │         │    "B" │      10. │
       └─────────┴────────┴──────────┘
       
  • Method Details

    • values

      public static AggregationLevels[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AggregationLevels valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null