Dataview sum of all prices in one row

Hello!
I have some notes with these fields in the frontmatter

---
type: item
price: 110
---

I need Dataview query that displays only one row - the total sum of the prices of all notes.
Thanks a lot.

The query would look something like:

```dataview
TABLE sum(rows.price)
GROUP BY true
```

This displays the sum of the price field from all of your notes. The GROUP BY true is used to allow for the query to use aggregated functions.

However, as this query stands it’ll actually do a search for all notes, so I would strongly suggest limiting it somehow to relevant files. For starters by only including files which actually have a price field, and afterwards possibly by limiting to some folders or notes which are likely to have. Your daily notes might possibly not be interesting, but maybe a folder/tag/… indicating what you’ve bought or used money could be useful.

Another neat variant could be to group the result by item types, and then we would have a query like:

```dataview
TABLE sum(rows.price)
WHERE price
GROUP BY item
```

Finally, there are plenty of examples both at the main documentation for dataview, and within this forum on variant over this theme on doing summation.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.