anchor.diff:        begin
           if not VarIsNull (aValue) then
             FIntegerValue.Value := FIntegerValue.Value + 1;
  +      end;
  +    soCountDistinct:
  +      begin
  +        if not VarIsNull(aValue) then
  +        begin
  +          case FDefinition.FieldType of
  +            ftInteger, ftLargeint:
  +              begin
  +                tmpInt:= aValue;
  +                tmpString := IntToStr(tmpInt);
  +              end;
  +            ftFloat, ftDateTime, ftDate, ftTime, ftTimeStamp:
  +              begin
  +                tmpDouble:= RoundDoubleToStandardPrecision(aValue);
  +                tmpString := FloatToStr(tmpDouble);
  +              end;
  +            ftString, ftGuid:
  +              begin
  +                tmpString := VarToStr(aValue);
  +              end;
  +          end;
  +          if not FUniqueValues.Contains(tmpString) then
  +          begin
  +            FIntegerValue.Value := FIntegerValue.Value + 1;
  +            FUniqueValues.Add(tmpString, FUniqueValues);
  +          end;
  +        end;
         end;
       soSum:
         begin
  
positive.code:   FDoubleValue.Free;
    FStringValue.Free;
    FIntegerValue.Free;
    inherited Destroy;
  end;
  
  
negative.code:     FDoubleValue : TNullableDouble;
      FStringValue: TNullableString;
      FIntegerValue: TNullableInteger;
      FUniqueValues: TmStringDictionary;
  
      FDefinition : TmSummaryDefinition;
  
  