blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
6.91k stars 407 forks source link

Notion-like Formulas #575

Open crazymedguy opened 2 years ago

crazymedguy commented 2 years ago

Hello, would like to advocate for Notion-like formulas in dataview. This would take it to the next level.

For example SUMOF to add up all the available columns together... performing mathematical operations on attributes... concatenating/splitting of strings... Logic operators (if, or, and) True/false booleans

I realise it's quite a crazy undertaking but if this could be a future direction for dataview I would be insanely grateful. Also super willing to help fund the development, as I'm sure others would too.

blacksmithgu commented 2 years ago

Dataview supports row-level computations already, things like

TABLE name, (rating * 7 + 4) AS "Custom Rating", max(field1 / field2, field3) AS "Max Thing", ...

The documentation shows the list of logical operators & functions you can use, which should cover basic scenarios. The major thing it is lacking is column-level computations (computing sums and so on), which I have in mind but haven't implemented yet.

blacksmithgu commented 2 years ago

More specifically, there is basic support for everything you mention except SUM/etc over all values in a column.

crazymedguy commented 2 years ago

@blacksmithgu that's amazing, didn't realise you could do that. Column-level computations would indeed be really amazing.