Open fdw opened 4 months ago
I'm not opposed to this, but I'd need a design on how this would work. How would you express such formulas?
I left it vague on purpose, because I don't have a very good idea. I think I'd adopt the general syntax of Excel formulas with =<function>(<parameters)
. The only question is how to reference other cells/rows/columns etc. Maybe with a simple [<column>,<row>]
.
For example, =sum([1,1], [1,2])
to add the two cells in the first column?
From that, maybe [1,]
for all items in the first column and [,1]
for the first row?
@fdw I am actually doing all of what you described already using templates. E.g. summing up all rows of a table and display the result in the last row as total. For sure the code required is much more complex than Excel formulas, but at the same time it is much more flexible. I might be able to help out if you could describe the concrete use case you are trying to solve.
Hey, thank you! 🙂
I don't have one specific use case; rather, I often do small-ish calculations in Excel/LibreOffice Calc to budget or plan or choose between different alternatives. Usually, I enter some data (one- or two-dimensional) and then throw some calculations at it. So just summing up all rows or columns wouldn't nearly be enough, unfortunately.
One example that comes to mind is first summing up one column (and showing that in a cell), multiplying it with a factor (another cell) and finally a comparison of that with a fixed number.
Maybe you can have a look at my createView
space script as an inspiration. Using such functions you can actually build your own ecosystem of aggregation and calculation functions. It doesn't work like excel, but if you are familiar with database views - this is the way to go.
That is cool, thank you! Unfortunately, I think I'd need something more flexible (and per-cell) because I want to do more than aggregating tables 😕
But it's a nice script and could come in handy for some other table. And it's not even that much code. Thanks for sharing! 🙂
First of, Silverbullet feels really nice to use (if your server is fast enough 😉), so thank you very much!
One feature that would help me quite a bit is more comfortable table support, especially (simple) formulas like "sum of all entries in this column/row", "difference between this and that" and stuff like that. But I can understand if that is outside of the scope for a wiki 😉