In an otherwise empty *.org file I have a table like
#+TBLNAME: tbl1 |Name|Value| |A | 1| |B | 2| |A | 3| and I want to somehow create a table that should look something like this:
#+TBLNAME: tbl2 |Name|Frequency|Sum| |A |2 |4 | |B |1 |2 | In my real case tbl1 is 150 rows and changing, so it is only feasible if tbl2 is autogenerated somehow.
#+TBLFM: @2$2..@>$2='(length (org-lookup-all $1 '(remote(tbl1,@2$1..@>$1)) '(remote(tbl,@2$2..@>$2)))) Produces the desired content for column 2 in tbl2, but
#+TBLFM: @2$3..@>$3='(apply '+ (org-lookup-all $1 '(remote(tbl,@2$1..@>$1)) '(remote(tbl1,@2$2..@>$2)))) produces "#ERROR" with the following content in Substitution history:
Substitution history of formula Orig: '(apply '+ (org-lookup-all $1 '(remote(tbl,@2$1..@>$1)) '(remote(tbl,@2$2..@>$2)))) $xyz-> '(apply '+ (org-lookup-all $1 '(remote(tbl,@2$1..@>$1)) '(remote(tbl,@2$2..@>$2)))) @r$c-> '(apply '+ (org-lookup-all $1 '(#("A" 0 1 (fontified t face org-table)) #("B" 0 1 (fontified t face org-table)) #("A" 0 1 (fontified t face org-table))) '(#("1" 0 1 (fontified t face org-table)) #("2" 0 1 (fontified t face org-table)) #("3" 0 1 (fontified t face org-table))))) $1-> '(apply '+ (org-lookup-all "B" '(#("A" 0 1 (fontified t face org-table)) #("B" 0 1 (fontified t face org-table)) #("A" 0 1 (fontified t face org-table))) '(#("1" 0 1 (fontified t face org-table)) #("2" 0 1 (fontified t face org-table)) #("3" 0 1 (fontified t face org-table))))) Result: #ERROR Format: NONE Final: #ERROR When appending ";N" to the second TBLFM, both rows in tbl2 "Sum" is 6 (that is, the sum of all entries).
What is wrong with the second TBLFM?
'(remote(tbl1,@2$2..@>$2))the third argument oforg-lookup-allrather than the ending of the second argument?