Search code examples
ssas

Testing a cube - is slicing by each dimension in turn sufficient?


One for the mathematicians.

Say I have two cubes, or dimensionally-modelled datasets A and B.

To prove that they're identical, is it sufficient to slice each of them by every dimension in turn, and verify that the totals for each member are identical?

A simple example: dimensions Country (England and Scotland), Gender (Male and Female) and Married (Yes or No). Measure CountPeople.

If I slice CountPeople by Country, comparing the results from A and B, then by Gender, then by Married, and find identical results, have I proved that every cell in A and B is identical?

I think that I have, but I'm not sure.


Solution

  • No, slicing on each dimension in turn is not sufficient to prove that the cubes are identical at cell level. It probably will be close enough most of the time, but it's not mathematically guaranteed.

    We can prove this with a fairly simple example with just Gender and Country dimensions. Imagine we have the following data at cell level:

    • (Male, England): 100, (Female, Scotland): 100

    If we slice separately by Gender or Country we get:

    • Male: 100, Female: 100
    • England: 100, Scotland: 100.

    Now if all of those males move to Scotland and all the females move to England, we'll have different data at cell level:

    • (Male, Scotland): 100, (Female, England): 100

    But the data reported by either single dimension will be the same:

    • Male: 100, Female: 100
    • England: 100, Scotland: 100

    This is a fairly trivial example, but the same possibility exists for non-trivial data, so to be 100% sure two cubes are identical, you would need to validate at cell level.