How and when to extend tuples: Beyond what is written in the documentation

Hi

My question is regarding when to use Extend calculation on new tuples for all members of.
By experience I would know when to active on correct dimension, but there are occasions when it’s strange and some even don’t make any sense.
What also makes someone confused is the text in the documentation:

The values in the factor Cubes are processed for all Entities in the structure of the target Cube, at the highest level of granularity. This is similar to what would happen if you added the factor Cubes to a Layout as Blocks and set all the Entities in the target Cube structure in "By Row" in the Axis area.The result is a set of combinations of the members of Entities that are in the Structure of the target Cube which have a non-zero value on at least one of the Blocks of the Layout and are in the currently active Select.

By the text I would assume that if I put all entities of the target cube by row and the factor cubes in the layout, that whenever I get a non-zero value that this is a tuple that exist in the calculation domain and therefore the formula is executed and written to my target cube.
With this I build an example, procedure 1:

Cube A1: Month, Country, ProfitCenter, Unit
Cube B: Month, Currency
Cube C1: Month, Country, Currency, ProfitCenter, Unit
Target C1: a/b
All cubes are physical.

I entered value 100 in Cube A1 in intersection
Month: Jan23
Country: Sweden
ProfitCenter: Other
Unit: Other

I entered value 5 in Cube B1 in intersection
Month: Jan23
Currency: SEK

The result in cube C was 100/5= 20. In the procedure debugger just before step of calculating cube C1 I did what the documentation said and put all target C1 entities on row when factor cubes are in the layout. This showed me correctly that there was a value in Jan23, Sweden, SEK, Other, Other.
Above just confirmed everything that the documentation wrote.
When I in an existing procedure (2) then changed accordingly to the documentation the calculation didn’t work if i didn't extend on entity Currency. The funny thing was that the cubes in procedure 2 had the same entities as in procedure 1, even cube B was exactly the same cube. The rest of the cubes are called A2 and C2 for the sake of examples.
I then took the dataflow step from procedure 1 and put that in procedure 2 and I still got values in cube C1. I then added a step in procedure 2 so that cube A1 was populated with the same values as A2 and I still got values in C1 without extending any tuples while C2 don’t get any value if I don’t extend the tuples in Currency. I think I even tested with a dataflow step with cubes A1, B and C2 and that didn’t work.

So the question goes back to when I should extend the tuples. I have one example where it works as I understand the documentation but I also have an exactly same case when it doesn’t works as the documentation states.

Answers

  • Leone Scaburri
    Leone Scaburri Employee
    First Anniversary First Comment Level 100: Foundations of Building in Board Level 200: Leveraging Board for Business Insights
    edited April 2023

    Dear Gustavo,

    the logic you applied to extend domain seems correct. You want to add an additional dimension called "Currency" to your cube A1 tuple, so you extend domain on "Currency".

    Be aware your case seems to be an example of a JOIN calculation, which is a particular algorithm with its own domain configuration rules which does not require any extend. You can check the algorithm applied within DB logs.

    The Dataflow step may use different types of algorithms for its calculations, depending on certain conditions related to the structures of the Cubes involved and the formula:

    • JOIN. This calculation algorithm is only used when the calculation domain options are in the default configuration and the Layout contains three Cubes whose structures meet the following conditions:
      • One factor Cube has n dimensions in its Structure, where is any number
      • The second factor Cube has at least a dimension in the Structure of the other factor Cube
      • The target Cube has in its Structure all the dimensions of the factor Cubes and exactly one more than the first factor Cube (n+1)

  • Gustavo Camacho
    Gustavo Camacho Active Partner
    Name Dropper First Comment First Anniversary

    Hi

    Yes i can see that it uses Join+ calculation even though i can't get in go with the explanation.

    If target cube has n+1(5D), then first cube is the n cube (4D). This leave the second cube to be the one that has 2 dimensions, Month and Currency (2D).
    If so i can't get that to fit the text:

    • The second factor Cube has one dimension less than the target Cube and at least a dimension in the Structure of the other factor Cube

    But the most important question is why i get Join+ calculation in one dataflow while i get Tuples calculculation in the second dataflow (and need to extand tuples) if the dimensionality is the same and the data is the same.

    Here i need to expand tuples:

    While here there is no need to expand tuples

    This goes also back to whats written in the documentation

    The values in the factor Cubes are processed for all Entities in the structure of the target Cube, at the highest level of granularity. This is similar to what would happen if you added the factor Cubes to a Layout as Blocks and set all the Entities in the target Cube structure in "By Row" in the Axis area.The result is a set of combinations of the members of Entities that are in the Structure of the target Cube which have a non-zero value on at least one of the Blocks of the Layout and are in the currently active Select.

    How should i interpret the above text using my examples?

  • Dear @Gustavo Camacho,

    you are looking at the case on the other way around. To use the Join alg Board requires as condition "the calculation domain options are in the default configuration" which means no extend are defined. While extending your domain you are forcing the dataflow to adopts the Tuples alg.

    Then you are exactly in the JOIN conditions situation:

    • One factor Cube has n dimensions in its Structure, where n is any number (Month, Country, ProfitCenter, Unit)
    • The second factor Cube has an n+1 dimension (Currency) and at least a dimension in the Structure of the other factor Cube (Month)
    • The target Cube has in its Structure all the dimensions of the second factor Cubes and exactly one more than the first factor Cube (Month, Country, ProfitCenter, Unit just Currency is missing)