Plugin: markdown table calculations

Not possible. Plugins currently only work on desktop

Okay, thanks. Any prospects for the future?

Just started using this plugin. Very handy.

A feature that would be great is if a formula could be defined for entire rows or columns.
For instance consider the following example for calculating work hours, days and weeks:

| Type      | Hours | Days | Week |
|-----------|------:|-----:|-----:|
| Project A |   152 |   19 |  3,8 |
| Project B |    80 |   10 |  2,0 |
| Project C |    96 |   12 |  2,4 |
| TOTAL     |   328 |   41 |  8,2 |

Being able to define one formula that for each row added calculates the Days and Weeks column values from the Hours column values, and for the Total row: sum of the values above.

| Type      | Hours | Days | Week |
|-----------|------:|-----:|-----:|
| Project A |   152 |      |      |
| Project B |    80 |      |      |
| Project C |    96 |      |      |
| TOTAL     |   328 |      |      |
<!--TBLFM C*=B*/8 D*=C*/5 *4=sum(above)-->

The syntax is just one idea. Maybe difficult to realize, but I think it would increase the plugin's usefulness enormously.

MaBo

1 Like

Thanks for the great plugin @oskar.swida! I was wondering if it was possible to make this compatible with the Turn to chart plugin created by @SamuelGagnepain? Currently, this plugin won't look inside code blocks for tables so I think the solution would be to make an exception for turnToChart code blocks:

```turnToChart

```

Hi,
I will look if I'm able to parse tables inside code blocks. If this is possible, then I will include the support (perhaps with the configuration option to switch this feature on/off).

1 Like

Please check the new 1.0.5 version, it supports table parsing inside code blocks. I have not implemented the configuration option - after some thinking I've ended with conclusion that TBLFM expressions are inserted deliberately meaning that the author wants them to be computed.

1 Like

Works great, thanks so much! The table calculations and charts generated from it are pretty seamless now. :slight_smile:

I actually have two more requests:

  1. I'm noticing that blank cells will cause errors. e.g. in a range of cells that is summed or when adding cells together. Would it be possible to have blank cells counted as 0 for these cases? Ideally I don't have to manually put a 0 in blank cells.
    image
  2. Whenever the table calculations are done, the row lengths are made as compact as possible, while instead I would like things to line up as done using the markdown table formatter plugin. It would be great if this could be added as an option for the output so that I don't have to manually reformat the table every time I do the table calculations.
    image

Maybe the markdown calculations plugin can check whether the table formatter plugin is installed and if so just call it.

Regarding the first request: I suppose it is perfectly possible, however I need to make this configurable. Supported formula functions can also include operations on strings, so sometimes empty cells could be interpreted as empty text.
As about the second one - let me do some research, I suppose I know why we observe such behaviour but I'm not sure if I will be able to solve it asuccessfully.

1 Like

Hey together,
i'm not sure about using TBLFM as multiline
if i try something like this.. it doesnt work

| Column A | Column B | Column C |
|:---------|:---------|:---------|
| 123      | 456      |1092|
| 0        | 0        ||
<!--TBLFM C2=A1+A2; 
C1=56*78/4 -->

Thank you very much for the amazing work. I starting using the extension today. I was wondering, is there a way to select a whole column? Like

| Column A | Column B | Column C |
|:---------|:---------|:---------|
| 123      | 456      |1092|
| 8       | 1        |  8     |
| 3        |  3       |   |
<!--TBLFM C3=SUM(A:A)-->

Hi,
If you think about some syntax which does not require to specify row numbers - I'm afraid it is not possible.

Yes i was thinking exactly of that. Too bad. But thank you for the quick answer

Hi,
Any chance to specify the precision of the float number?

image

Hi,
The formula library used in the project does not allow this, however I could think about some additional parsing. Any suggestions regarding syntax?

Hi @novelx
I use the function ROUND (Number; Count) Rounds a number to a certain number of decimal places. (replace “Number” by the math expression between brackets).

1 Like

Thanks, it works

Could you please clarify it with an example?

Hi you should add for example for the expression A1/B1 that has as result 1.2222 this: "Round ((A1/B1);1)) to obtain 1.2, but when I wanted to prepare an example from Joplin I found the plugin does not work properly.
@oskar.swida do you know if there is an issue with the plugin, or there is any incompatibility with other plugin impacting Markdown table?

Thank you for explaining! But I don't seem to get it to work.
for example how do I add it to this formula: <!--FM CONCATENATE((A1/121)*21, " €")-->
or to this one: <!--FM CONCATENATE(A1-B1, " €")-->