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

Relative and absolute reference inconsistency inside the evaluate formula feature #65

Open
ceELnO opened this issue Jun 4, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@ceELnO
Copy link

ceELnO commented Jun 4, 2023

Describe the bug
This may not necessarily be a bug, although, it is inconsistent, and that inconsistency is highly annoying and unintuitive.

When referring to an absolute value using the comments below the table for automatically determining a value of a given column, the absolute references ignores the second row (the one which does not contain any cells which actually shows up inside the reading render of the table). In contrast, the relative reference does not ignore the row which does not appear inside the rendering of the table.

For this table here are the absolute references listed:

@1$1 @1$2 @1$3
@2$1 @2$2 @2$2
@3$1 @3$2 @3$2
@4$1 @4$2 @4$2
| @1$1 | @1$2 | @1$3 |
| ---- | ---- | ---- |
| @2$1 | @2$2 | @2$2 |
| @3$1 | @3$2 | @3$2 |
| @4$1 | @4$2 | @4$2 |

In comparison, this is the relative references listed for the absolute cell: @3$2:

@-3$+1 @-3 @-3$+1
@-1$-1 @-1 @-1$+1
$-1 @3$2 $+1
@+1$-1 @+1 @+1$+1
| @-3$+1 | @-3  | @-3$+1 |
| ------ | ---- | ------ |
| @-1$-1 | @-1  | @-1$+1 |
| $-1    | @3$2 | $+1    |
| @+1$-1 | @+1  | @+1$+1 |

Again, this may not be a bug in itself, although, I feel like somebody got to report the inconsistency

To Reproduce
Here is a example of how to reproduce the issue:

Insert the following table into the text file:

| 1   | 2   | 3   |
| --- | --- | --- |
| 4   | 5   | 6   |
| 7   | 15  | 11  |
| 8   | 9   | 10  |
<!-- TBLFM: @3$2=@-2 -->

Evaluate the formula using Advanced tables Obsidian "evaluate formula" feature.

Expected behavior
What occurs is the "15" addressed as "@3$2" becomes a "---", what I would expect is for the cell "@3$2" to become a "2"; if you assume that the relative measurement should be adjusted after the absolute ones that is. Either way, to be clear:

The behavior

| 1   | 2   | 3   |
| --- | --- | --- |
| 4   | 5   | 6   |
| 7   | --- | 11  |
| 8   | 9   | 10  |
<!-- TBLFM: @3$2=@-2 -->

The desired behavior:

| 1   | 2   | 3   |
| --- | --- | --- |
| 4   | 5   | 6   |
| 7   | 2 | 11  |
| 8   | 9   | 10  |
<!-- TBLFM: @3$2=@-2 -->

Desktop:

  • Windows 10
  • Obsidian Version: v1.3.5
  • Advanced Tables Version: 0.18.1

Additional notes
I might have made some mistake inside the table example of all the absolute and relative references, since I just observed the pattern and filled in the rest, but the steps to reproduce the bug should be right.

@ceELnO ceELnO added bug Something isn't working needs-review labels Jun 4, 2023
@tgrosinger tgrosinger transferred this issue from tgrosinger/advanced-tables-obsidian Jul 14, 2023
@tgrosinger
Copy link
Owner

Thanks for the bug report on this. I agree that this is inconsistent and definitely not desirable. Unfortunately at this point fixing it would be a major breaking change, so I think I had to leave it as is. Maybe (hopefully) some day if there is a need for other breaking changes this can be fixed.

@ceELnO
Copy link
Author

ceELnO commented Jul 15, 2023

Yeah, sounds highly reasonable, since changing what the references point to, might ruin some older uses of the references. Besides, it is easy to work with with the inconsistency anyways, once you get used to it. I would not expect any change anytime soon; instead, it was at the time of writing, mostly just done to bring awareness to the issue, and maybe something happens a few years later, maybe.

@ceELnO ceELnO closed this as completed Jul 15, 2023
@ceELnO ceELnO reopened this Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants