For me this problem occurs when using org-lookup-first. However, I think this might happen in a lot of other circumstances as well. When specifying a range of cells for example via @1$1..@>$1
it looks like empty cells in this range are compressed/omitted (@1$1..@>$1
should select the whole column of a table).
When selecting multiple columns like this this can cause weird behavior, because the two lists could have different lengths. The problem occurred to me when following this tutorial so maybe this helps.
Example:
#+TBLNAME: the-tbl
| First Line | 1 |
| Second Line | 2 |
| Third Line | 3 |
| *some additional lines* | |
| Fifth Line | 5 |
| | 6 |
| Seventh Line | 7 |
| *another additional line* | |
| Ninth Line | 9 |
| Tenth Line | 10 |
| Eleventh Line | 11 |
| First Line | 1 | 1 | OK |
| Third Line | 3 | 3 | OK |
| No Line | nil | nil | OK |
| Fifth Line | 6 | 5 | Wrong because Line 4 has no value thus it is one shorter |
| Seventh Line | 7 | 7 | Only OK, because now both columns have a missing value |
| Tenth Line | 11 | 10 | Wrong again, because column 2 had another missing value |
#+TBLFM: $2='(org-lookup-first $1 '(remote(the-tbl, @1$1..@>$1)) '(remote(the-tbl, @1$2..@>$2)))
Are there any ways to select columns like this, but maintaining empty cells? Or is there a better function than org-lookup-first for what I'm doing?