Dear emacs and org-mode comrades.

Given:

  • a table with
    • a list of tags +
    • their number of appearances in question 1 (Q1) & and question 2 (Q2).
  • org support for tag groups (https://orgmode.org/manual/Tag-Hierarchy.html)
  • 3 defined tag groups
    • GroupTag1 (GT1)=tagA+tagC+tagD and
    • GroupTag2 (GT2)=tagB+tagE
    • GroupTag3 (GT3)=tagB+tagC+tagD (yes, some tags are in more than 1 group)

How can I count with pure elisp (assuming some table formula but I’m open to other ways) the sum of individual tag appearances of each tag group, for each question?

Example:

| tag  | Q1 | Q2 |
|------+----+----|
| tagA |  9 |    |
| tagB |  4 |  2 |
| tagC |  1 |  4 |
| tagD |    |  5 |
| tagE |    |  6 |
|------+----+----|
| GT1  | 10 |  9 |
| GT2  |  4 |  9 |
| GT3  |  5 | 11 |

Thanks a lot for your time and attention… :)

  • EduMerco@lemmy.mlOP
    link
    fedilink
    arrow-up
    1
    ·
    18 days ago

    Dear @sachac (BTW, are you the legendary Sacha Chua?)

    There was a parenthesis missing in the end, but it is working!!! :)))

    I still have to understand the scope (does it works on the heading/ tree where it is called only, can I “point it” to a specific table, etc.) but it is a really great step forward.

    And, as I wanted, it is short, simple, elegant, works perfectly and -specially- shows the power of elisp and how literate programming can be useful and powerful for reproducible research (this is part of my thesis).

    I may continue with some questions, but it helps me a lot to learn.

    Thank you so much! :D