Grouping and counting in Xano

Options
We have a requirement to produce a report which shows a list of Users grouped by City. The report displays a count of Users per City and is sorted in descending order of count.  This data is available from an API.

Report example:

City | Number of Users
Bristol 43
Liverpool 39
Chester 25
etc

We can product a report like this in JavaScript, but I'd much prefer to do this in Xano.  

Would it be possible?

Tony

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Yes this is definitely possible in Xano.

    You can do this with the Query All Records function. Choose the aggregate return method and you'll have access to group by, aggregate by, sort by, etc.
    (Output tab > Return > Aggregate)

    [Screenshot_2021-08-13_17-24-19.png]
  • Mr_English
    Options
    Nice!!