anchor.diff:    begin
       currentCoord := '';
       tmpIndex := FVerticalKeysIndex;
  +    parentKeyValue := '';
       for k := 0 to FVerticalGroupByDefs.Count -1 do
       begin
         tmpValue := FDataProvider.GetDatum(i).GetPropertyByFieldName(FVerticalGroupByDefs.Get(k).FieldName);
  +      // tmpKeyValue is the calculate value based on tmpValue which is the actual value
  +      // GetIndexKeyValue apply the GroupByOperator of the GroupByDef to the actual value
         tmpKeyValue := GetIndexKeyValue(tmpValue, FVerticalGroupByDefs.Get(k));
         FVerticalValues.Get(k).AddValueIfMissing(tmpKeyValue);
  +      if parentKeyValue <> '' then
  +        tmpIndex := tmpIndex.AddSubIndexForKey(parentKeyValue);
  +      parentKeyValue := tmpKeyValue;
  +      tmpIndex.AddValueIfMissing(tmpKeyValue);
   
         currentCoord := BuildKey(currentCoord, tmpKeyValue);
  -      if k < (FVerticalGroupByDefs.Count - 1) then
  -        tmpIndex := tmpIndex.GetSubIndex(tmpKeyValue)
  -      else
  -      begin
  -        tmpIndex.GetValueList(tmpKeyValue).Add(i);
  -        tmpIndex.KeysValues.Add(tmpKeyValue);
  -      end;
       end;
   
       tmpIndex := FHorizontalKeysIndex;
  +    parentKeyValue := '';
       for k := 0 to FHorizontalGroupByDefs.Count -1 do
       begin
         tmpValue := FDataProvider.GetDatum(i).GetPropertyByFieldName(FHorizontalGroupByDefs.Get(k).FieldName);
         tmpKeyValue := GetIndexKeyValue(tmpValue, FHorizontalGroupByDefs.Get(k));
         FHorizontalValues.Get(k).AddValueIfMissing(tmpKeyValue);
  +      if parentKeyValue <> '' then
  +        tmpIndex := tmpIndex.AddSubIndexForKey(parentKeyValue);
  +      parentKeyValue := tmpKeyValue;
  +      tmpIndex.AddValueIfMissing(tmpKeyValue);
  +
         currentCoord := BuildKey(currentCoord, tmpKeyValue);
  -      if k < (FHorizontalGroupByDefs.Count - 1) then
  -        tmpIndex := tmpIndex.GetSubIndex(tmpKeyValue)
  -      else
  -      begin
  -        tmpIndex.GetValueList(tmpKeyValue).Add(i);
  -        tmpIndex.KeysValues.Add(tmpKeyValue);
  -      end;
       end;
   
       tmpList := FRecordCoordinates.Find(currentCoord) as TCardinalList;
  
positive.code:   public
      constructor Create;
      destructor Destroy; override;
      function GetSubIndex (const aKey : string): TmKeysIndex;
  
      property KeysValues : TStringList read FKeysValues;
    end;
  
    { TKeyValuesForGroupByDef }
  
negative.code:     property SummaryDefinitions : TmSummaryDefinitions read FSummaryDefinitions;
  
      // output values
      property VerticalValues: TKeyValuesForGroupByDefs read FVerticalValues; // the collection of all key values for any vertical level
      property HorizontalValues: TKeyValuesForGroupByDefs read FHorizontalValues; // the collection of all key values for any vertical level
      property VerticalKeysIndex : TmKeysIndex read FVerticalKeysIndex;
      property HorizontalKeysIndex : TmKeysIndex read FHorizontalKeysIndex;
    end;
  