obsidian-db-folder icon indicating copy to clipboard operation
obsidian-db-folder copied to clipboard

[FR]: Footer Number Functions for Formulas and Rollups

Open liznelson opened this issue 2 years ago • 2 comments

Contact Details

[email protected]

Present your request

Right now footer formula features like sum, min, max are only available to number type columns. The problem is Formulas and Rollups are often used to create number type columns. Ideally, these number functions would be available for Formulas and Rollups so we could sum a formula column.

Additionally, please add an average function.

For which platform do you request this request??

Desktop

liznelson avatar Apr 12 '23 08:04 liznelson

hello @liznelson , currently formulas returns always a string value due the component rendering structure.

On the other hand, in the formulas you have available the methods that the footer uses for the numbers

for example:

db.numbers.sum(<array of values>)

Checkout interfaces https://github.com/RafaelGB/obsidian-db-folder/blob/master/src/cdm/ModulesFnModel.ts

Hope it helps

RafaelGB avatar Apr 13 '23 21:04 RafaelGB

Hi @RafaelGB,

Sorry if this is a dumb question. How do you return all the values of a column as an array? My goal is to use that in the sum function inside a footer formula? I just can't figure it out. I tried the following (along w/ a few other silly attempts): db.numbers.sum(values["<name of column>"]) db.numbers.sum(values.<name of column>) db.numbers.sum(${values["<name of column>"]}) db.numbers.sum(${values.<name of column>})

engr-lynx avatar Apr 22 '23 08:04 engr-lynx