* SCHEDULE A1112 #+NAME: SCHEDAP #+begin_src rec :data somefile.rec :type Finance :fields AccountDate,Shares,Description,AccountAmount :sort AccountDate,Description :results silent (File = 'Estate' && AccountSchedule = 'A') #+end_src #+RESULTS: SCHEDAP #+NAME: SCHEDA #+begin_src emacs-lisp :var table=SCHEDAP :exports results (setq table (cons 'hline table)) (setq table (cons '("Date" "{{{cmhfill}}} Shares" " Description " "{{{cmhfill}}} Inventory{{{cm1space}}}Value") table)) (setq table (append table '(("| |Total Schedule A")))) (setq table (append table '(("\n#+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f::")))) table #+end_src #+ATTR_LATEX: :mode table :environment longtable :align p{60pt}N{5}{3}p{275pt}N{8}{2} #+RESULTS: SCHEDA | Date | {{{cmhfill}}} Shares | Description | {{{cmhfill}}} Inventory{{{cm1space}}}Value | |------------+----------------------+------------------+--------------------------------------------| | 2018-03-18 | | Something | 49645.59 | | etc | | etc | 4878.51 | | | | Total Schedule A | 54524.10 | #+TBLFM: @>$>=vsum(@I$>..@>>$>);%.2f:: |