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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formula cross referencing (with multiple tables) #40

Open
scarfur opened this issue Jan 9, 2022 · 4 comments
Open

Add formula cross referencing (with multiple tables) #40

scarfur opened this issue Jan 9, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@scarfur
Copy link

scarfur commented Jan 9, 2022

First of all - thank you so much for this plugin 馃憤

May I ask if this (title) could be a thing in the future?
Would be awesome to, for example, sum up values from table1 with values from table2 in table2. Another example: fill a cell in table2 with a value from table1 and then sum it with another value from table2.

@tgrosinger
Copy link
Owner

@scarfur, I'm not sure how that could be implemented robustly in markdown. Do you have suggestions for how you would reference the other table? The only thing that comes to mind right now is line numbers, but that sounds very fragile.

@scarfur
Copy link
Author

scarfur commented Jan 20, 2022

@tgrosinger Referencing on lines seems to fragile, that鈥檚 true. Mr. Valentine uses ^tablename-next-line-under-table in his dice roller plugin (https://github.com/valentine195/obsidian-dice-roller), maybe that helps?!

@carllemp
Copy link

Maybe YAML could allow for some cross referencing if a table cell could reference a YAML key and the html comment that defines the formula could be enhanced. Instead of:

a format like Could assign the calculated value to both the table location (@>$3) and to a YAML key (Keyname). or Could assign the calculated value to a YAML key (YAMLKeyname). And then that YAML value (or any other) could be pulled into a table cell by linking to the YAML key in the cell instead of pushing the value into a cell through the formula itself? I think the 2nd option above would also allow calculated table values to be queried and summarized using plugins like DataView.

@quantimnot
Copy link

I am new to Obsidian and Org-Mode. I have no experience or knowledge in this area, but I was looking for a means to accomplish this. I noticed that Org mode supports this:

#+NAME: supplies
| Date       | Category         | Amount |
|------------+------------------+--------|
| 2014/01/14 | Supplies         |  43.97 |

#+NAME: expenses
| Category                 | Amount                       |
|--------------------------+------------------------------|
| Office Supplies/Expenses | :=remote(supplies,@>$3);%.2f |

Could this be possible:

<!-- TBLID: expenses -->
| Item      | Cost | Qty |
| --------- | ---- | --- |
| groceries | 666  | 1   |

| Item      | Monthly |
| --------- | ------- |
| groceries |         |
<!-- TBLFM: $>=remote(expenses, ($2*$3)) -->

Maybe a way to reference a table in a separate document:

| Item      | Monthly |
| --------- | ------- |
| groceries |         |
<!-- TBLFM: $>=remote(document, expenses, ($2*$3)) -->

@tgrosinger tgrosinger added the enhancement New feature or request label May 25, 2023
@tgrosinger tgrosinger changed the title Feature request: formula cross referencing (with multiple tables) Add formula cross referencing (with multiple tables) May 25, 2023
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

4 participants