partial definition of pt-build

This commit is contained in:
2025-05-11 21:39:27 -04:00
parent 9ec5c5ea6f
commit e5b0de99e2

View File

@@ -23,6 +23,32 @@
;;; Code:
(defun pt-build (source &key rows cols vals)
"Build a pivot table
The SOURCE value should be the table the data is being taken
from. ROWS and COLS should be lists of column references from
the source table to be used as rows and columns for the pivot
table. These can either be integers representing the column
number, or strings representing column names.
VALUES should be a list containing information about the values
in the body of the pivot table. Each element of the list should
be in the following format (REF FUNC &optional LABEL).
TODO: more documentation"
(let ((col-index (pt-get-columns source))
(index (pt-column-names source))
src-cols
(src-body (pt-get-body source))
(buckets (make-hash-table)))
(pt--index-columns rows)
(pt--index-columns cols)
(pt--index-columns vals car)
(sort src-cols #'<)
(dolist (record src-body)
(pt--process-record record source-cols buckets))))
;; Local Variables:
;; read-symbol-shorthands: (("pt-" . "pivot-table-"))
;; End: