title: Symfony Doctrine Group By Query
body: <p>I have below sql query running fine, </p>
  
  <pre><code>SELECT completed_by, count(*) AS Total
  FROM tasks
  WHERE completed_by is not null AND status = 1
  GROUP BY completed_by
  ;
  </code></pre>
  
  <p>Em am doing it with doctrine query builder, but not working returning an error.</p>
  
  <pre><code>$parameters = array(
                      'status' =&gt; 1,
                  );
  
  $qb = $repository-&gt;createQueryBuilder('log');
  $query = $qb
  -&gt;select(' log.completedBy, COUNT(log) AS Total')
  -&gt;where('log.Status = :status')
  -&gt;groupBy('log.completedBy')
  -&gt;setParameters($parameters)
  -&gt;getQuery();
  </code></pre>
  
  <p>and getting below error;</p>
  
  <blockquote>
    <p>[Semantical Error] line 0, col 21 near 'completedBy,': Error: Invalid
    PathExpression. Must be a StateFieldPathExpression.</p>
  </blockquote>