anchor.diff:      FIndex.GetValueList(Self.GetIndexKeyValue(tmpValue, FVerticalGroupByDefs.Get(newCurrentGroupByDefIndex))).Add(pointer(aCurrentRecNo)); //@tmpRecNoShell);
     end;
   end;
  +*)
   
   procedure TmVirtualDatasetPivoter.Calculate;
   var
     i, recCount : Cardinal;
  +  k : integer;
  +  tmpValue : Variant;
  +  tmpKeyValue : String;
  +  currentCoord : TRecordCoordinates;
   begin
     FGarbage.Clear;
  +
  +  FVerticalValues := nil;
  +  FHorizontalValues := nil;
  +
  +  SetLength(FVerticalValues, FVerticalGroupByDefs.Count);
  +  SetLength(FHorizontalValues, FHorizontalGroupByDefs.Count);
  +
  +  FVerticalRecordCoordinates.Clear;
  +  FHorizontalRecordCoordinates.Clear;
  +
  +  recCount := FVirtualDataset.DatasetDataProvider.GetRecordCount;
  +  for i:= 0 to recCount -1 do
  +  begin
  +    currentCoord := FVerticalRecordCoordinates.Add;
  +    for k := 0 to FVerticalGroupByDefs.Count -1 do
  +    begin
  +      FVirtualDataset.DatasetDataProvider.GetFieldValue(FVerticalGroupByDefs.Get(k).FieldName, i, tmpValue);
  +      tmpKeyValue := GetIndexKeyValue(tmpValue, FVerticalGroupByDefs.Get(k));
  +      if not FVerticalValues[k].Contains(tmpKeyValue) then
  +        FVerticalValues[k].AddValue(tmpKeyValue);
  +      currentCoord.Values[k] := tmpKeyValue;
  +    end;
  +    currentCoord := FHorizontalRecordCoordinates.Add;
  +    for k := 0 to FHorizontalGroupByDefs.Count -1 do
  +    begin
  +      FVirtualDataset.DatasetDataProvider.GetFieldValue(FHorizontalGroupByDefs.Get(k).FieldName, i, tmpValue);
  +      tmpKeyValue := GetIndexKeyValue(tmpValue, FHorizontalGroupByDefs.Get(k));
  +      if not FHorizontalValues[k].Contains(tmpKeyValue) then
  +        FHorizontalValues[k].AddValue(tmpKeyValue);
  +      currentCoord.Values[k] := tmpKeyValue;
  +    end;
  +  end;
  +
  +(*
     recCount := FVirtualDataset.DatasetDataProvider.GetRecordCount;
     if FVerticalGroupByDefs.Count > 0 then
     begin
       for i := 0 to recCount - 1 do
         CalculateSubIndex(FIndex, i, 0);
     end;
  +  *)
   end;
   
   { TmCalculationDefs }
  
positive.code: 
  uses
    sysutils, dateutils;
  
  { TmIndex }
  
  
negative.code:     FFieldName : String;
      FDataType : TFieldType;
      FCalculationKind : TmCalculationKind;
      FFormula : String;
    public
      constructor Create;
  
      property FieldName : string read FFieldName write FFieldName;
      property DataType : TFieldType read FDataType write FDataType;
      property CalculationKind : TmCalculationKind read FCalculationKind write FCalculationKind;
      property Formula : String read FFormula write FFormula;
    end;
  
    { TmCalculationDefs }
  