Short Form Rules

Some Custom Dimensions may have fairly simple and straight forward logic which defines them. For those cases, a set of short form rules can be used that provide a simpler ways to define a Custom Dimension. Short form rules are useful when you have simple cases where you do not need to combine rule types (i.e. Group and GroupBy rules).

Custom Dimensions defined using a short form rule use the same properties as any other Custom Dimension definition. However, instead of a Rules section, you use one of the two short form rules: Groups and GroupBy.

Groups Short Form Rule

The Groups short form rule allows you to easily define static element names with conditions for which charges go into the elements. All conditions are supported, including conditions with source overrides.

A Groups short form rule is defined as follows:

  <DimensionId>:
    <Base Dimension Properties>
    Groups:
      <Element Name 1>:
        - <Conditions>
      <Element Name 2>:
        - <Conditions>
      <Element Name N>:
        - <Conditions>

For example, consider a case where you have a simple mapping for environments where most charges can be determined by account IDs with a few exceptions. To do this with the Group rule, the definition would be:

  Environment:
    Source: Account
    Rules:
      - Type: Group
         Name: Production
         Conditions:
           - Equals: 
              - 123456789010
              - 123456789011
      - Type: Group
         Name: DevOps
         Conditions:
           - Equals: 
              - 123456789012
              - 123456789013
           - Source: CZ:Defined:Category
             Equals: Cloud Management
           - Source: Service
             Contains: Support      
      - Type: Group
         Name: Development
         Conditions:
           - Equals: 
              - 123456789014
              - 123456789015
      - Type: Group
         Name: Test
         Conditions:
           - Equals: 
              - 123456789016
              - 123456789017

Using the short from Groups rule, this can be simplified into:

  Environment:
    Source: Account
    Groups:
      Production:
         - Equals: 
            - 123456789010
            - 123456789011
      DevOps:
         - Equals: 
            - 123456789012
            - 123456789013
         - Source: CZ:Defined:Category
           Equals: Cloud Management
         - Source: Service
           Contains: Support      
      Development:
         - Equals: 
            - 123456789014
            - 123456789015
      Test:
         - Equals: 
            - 123456789016
            - 123456789017

GroupBy Short Form Rule

The GroupBy short form rule is useful when you are only grouping elements by a single set of sources, with or without transforms.

The GroupBy short form rule is defined as follows:

  <DimensionId>:
    <Base Dimension Properties>
    GroupBy:
      <Source Properties>
      Format: <Format string>
      Conditions:
         - <Conditions>

The properties supported in the GroupBy section are the same as the GroupBy rule except for the Type property, which is not used in this form.

So for example, if you were going to create a dimension that divided your charges by country code, you would define it as follows:

  CountryCode:
    Name: Country Code
    DefaultValue: Global
    Rules:
      - Type: GroupBy
        Source: Region
        Transforms:
          - Type: Split
            Delimiter: '-'
            Index: 1

Using the short form rule, this would be:

  CountryCode:
    Name: Country Code
    DefaultValue: Global
    GroupBy:
      Source: Region
      Transforms:
        - Type: Split
          Delimiter: '-'
          Index: 1

Did this page help you?