private function getAggregatedValue(array $options)
    {
        // for cases where the entity does not exist yet
        if (! $options['entity'] instanceof EntityInterface) {
            return '';
        }

        $config = explode(',', $options['fieldDefinitions']->getLimit(), 4);

        $configuration = new Configuration(TableRegistry::get($config[1]), $config[2]);
        $configuration->setJoinData($this->config->getTable(), $options['entity'])
            ->setDisplayField(isset($config[3]) ? $config[3] : '');

        $aggregator = new $config[0]($configuration);

        $factory = new FieldHandlerFactory($this->config->getView());

        return $factory->renderValue(
            $aggregator->getConfig()->getTable(),
            $aggregator->getConfig()->getDisplayField(),
            AggregateResult::get($aggregator),
            ['entity' => $options['entity']]
        );
    }