Grid Reports: Count Distinct

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • awltrs
    Junior Member
    • Apr 2025
    • 2

    #1

    Grid Reports: Count Distinct

    Hello all,

    I am currently working with reports in EspoCRM. For one of my use cases, I need to count distinct values. Is there a count distinct aggregate function available? If not, do you have any suggestions on how to make a distinct count work?

    Cheers,
    Anna
  • lazovic
    Super Moderator
    • Jan 2022
    • 979

    #2
    Hi awltrs,

    Only COUNT, SUM, MIN, MAX and AVG aggregate functions ins available in the Reports feature.

    Comment

    • yuri
      Member
      • Mar 2014
      • 8914

      #3
      Hi Anna,

      It's possible to specify complex expression for columns in Grid reports. Complex expressions are translated to SQL internally. Depending on database (MySQL/MariaDB or PostgreSQL), different output is produced.

      There's no built-in COUNT DISTINCT function in Espo. But it's possible to add custom complex expression function. https://docs.espocrm.com/user-guide/...stom-functions

      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment

      Working...