Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any chance this could be made to work together with formulas used by Advanced Tables? #117

Open
n00bmind opened this issue Mar 10, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@n00bmind
Copy link

Describe the feature

Hi.
I'm currently using the Advanced Tables plugin to add a simple "totals" column to my tables, which is super useful.
However, as described in https://github.com/tgrosinger/advanced-tables-obsidian/blob/main/docs/help.md, the way this works is by adding one (or more) html comment line of the form <!-- TBLFM: [formula] --> directly after the table, which is currently incompatible with the "chart from table" feature, as I cannot have both the formula and the required the block id marker as the next line after the table.

i.e. I'd need to be able to do something like this:

|       | Test1 | Test2 | Test3 |
| ----- | ----- | ----- | ----- |
| Data1 | 1     | 2     | 3.33  |
| Data2 | 3     | 2     | 1     |
| Data3 | 6.7   | 4     | 2     |
| TOTAL |       |       |       |
<!-- TBLFM: @>$2=sum(@I..@-1) -->
^table

but if I try something like this I get the error "Couldn't render Chart: There is no table at that id and/or file"

Does this fix a problem? If so, specify.

It does.
This would make Charts work with computed formulas, which adds a lot of power to a user's workflow!

Did you consider other alternatives?

I don't know any other alternatives at the moment..

Screenshots and recordings

No response

@n00bmind n00bmind added the enhancement New feature or request label Mar 10, 2024
@thiduzz
Copy link

thiduzz commented Mar 12, 2024

Going through the same drama as well 🤣

@Kolossi
Copy link

Kolossi commented Jul 1, 2024

@n00bmind @thiduzz I came here to +1 this, but I've actually just found a workaround :-)

The block id marker doesn't have to be following the table, it can be within it, so try changing your example table to:

| ^table | Test1 | Test2 | Test3 |
| ----- | ----- | ----- | ----- |
| Data1 | 1     | 2     | 3.33  |
| Data2 | 3     | 2     | 1     |
| Data3 | 6.7   | 4     | 2     |
| TOTAL |       |       |       |
<!-- TBLFM: @>$2=sum(@I..@-1) -->

If there was text in the first cell it could also be e.g.:

| Data ^table | Test1 | Test2 | Test3 |
| ----- | ----- | ----- | ----- |
| Data1 | 1     | 2     | 3.33  |
| Data2 | 3     | 2     | 1     |
| Data3 | 6.7   | 4     | 2     |
| TOTAL |       |       |       |
<!-- TBLFM: @>$2=sum(@I..@-1) -->

or put the block id in any other empty cell.

Seems to work in a similar example for me (desktop obsidian v1.6.5)

@n00bmind
Copy link
Author

n00bmind commented Jul 1, 2024

Amazing stuff. That seems to work for me just fine too..

@thiduzz
Copy link

thiduzz commented Jul 1, 2024

Good stuff @Kolossi ! Works for me as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants