Step 2: Writing a Rules Allocation Dimension

Once we have the RDS costs we want to split grouped as an element within a dimension, we are ready to build our Rules Allocation Dimension.

Let's stub out the dimension and see what information we need to add:

...
  SplitDataLake:
    Type: Allocation
    Name: Split Data Lake
    AllocateByRules:
      AllocationMethod: Proportional
      SpendToAllocate:
        ...
      AcrossElements:
        ...

Within the AllocateByRules rule, we can see that there are three main pieces of information we need to add.

  1. AllocationMethod - Here we have chosen Proportional, since we want the costs in this dimension to follow the relative costs of our products. We could also have chosen Even, and have the cost of our RDS database spread evenly among this dimension's elements.
  2. SpendToAllocate - This specifies what spend we want to split. In this case, it will reference the RDS spend we grouped in the previous step.
  3. AcrossElements - This specifies how we will split the cost. The elements referenced here will be the elements of our Rules Allocation Dimension as well, and their relative costs will define the proportionality of our split.

Note: there is an additional optional element ForEachElementOf that allows for further segmentation of SpendToAllocate. See Optionally Partition Rules Based Allocation Using ForEachElementOf for further documentation.

If you recall, our goal is to allocate the shared RDS spend to "Product A", "Product B", and "Product C" relative to the amount we are currently spending on each of those products.

665

๐Ÿ‘

If we had chosen an AllocationMethod of Even, then $3,333 would be assigned to each of "Product A", "Product B", and "Product C" in the above image.

First, we will use SpendToAllocate to specify the Shared Data Lake element in the Shared RDS dimension.

...
  SplitDataLake:
    Type: Allocation
    Name: Split Data Lake
    AllocateByRules:
      AllocationMethod: Proportional
      SpendToAllocate:
        Source: User:Defined:SharedRDS
        Conditions:
          - Equals: Shared Data Lake
      AcrossElements:
        ...

Next, we will use AcrossElements to define the output elements for our split. In this case, we want to split relative to the elements "Product A", "Product B", and "Product C" in the dimension SingleTenantProduct.

...
  SplitDataLake:
    Type: Allocation
    Name: Split Data Lake
    AllocateByRules:
      AllocationMethod: Proportional
      SpendToAllocate:
        Source: User:Defined:SharedRDS
        Conditions:
          - Equals: Shared Data Lake
      AcrossElements:
        GroupBy:
          Source: User:Defined:SingleTenantProduct
          Conditions:
            - Equals:
              - Product A
              - Product B
              - Product C

Notice that under AcrossElements we have used the GroupBy shorthand to clearly express the logic. It is also possible to use the Groups shorthand or the standard Rules long form syntax. A full overview of how to write Rules Allocation Dimensions can be found here: Short Form Rules.

With that, we are finished! Let's review everything in the next step.

Link to Previous Step