conorheffron / ironoc-db

Sample Data Manager Service with UI
https://ironoc-db-svc-902038140834.europe-north1.run.app
GNU General Public License v3.0
1 stars 0 forks source link

Implement aggregation functionality #224

Open conorheffron opened 5 days ago

conorheffron commented 5 days ago

AVG, SUM etc and group by for age values etc.

conorheffron commented 14 hours ago

Code samples, snippets (may be possible to doas UI task only via Thymeleaf)

<table>
    <tr th:each="count,iterator: ${product.paidService}">
        <td th:text="${iterator.index+1}" />
        <td th:text="${count.name}" />
        <td>Paid</td>
        <td th:text="${count.price}" />
    </tr>

    <tr>
        <td colspan="3" />
        <td><b th:text="${#aggregates.sum(product.paidService.![price])}" /></td>
    </tr>
</table>
<span th:text="${#aggregates.avg(employee.reviews.![grade])}" />
<tbody>
  <tr th:each="category : ${categories}">
    <td th:text="${category.name}" />
    <td th:text="${#lists.size(category.subCategories)}" />
    <td th:text="${#aggregates.sum(category.subCategories.![#lists.size(products)])}" />
  </tr>
</tbody>