public function getBaseStatsQuery($parentObject)
    {
        $baseQuery = $parentObject->queryChildObjects($this->primaryModel);
        $query = new Query();
        $query->from(['(' . $baseQuery->createCommand()->rawSql . ') innerQuery']);

        return $query;
    }