A simple Clojure OLAP web-application using the Mondrian engine. Includes a simple browser-based query constructor and functions for generating MDX queries from Clojure data structures.
![]() |
![]() |
Initially designed for usage with the Northwind sample database under PostgreSQL. Created in May 2025 as a university project.
The web interface is implemented using Alpine.js and native browser APIs.
To run the app, you need to acquire the Mondrian JARs. They are not currently
publicly available through Maven repositories, so you need to download them
manually and put under the jars folder. They can be downloaded from the
Ruby mondrian-olap repository.
The dependencies in deps.edn are specified for the JAR files provided in the
commit linked above. You may try to use newer versions, but in that case the
:modrian-jars alias needs to be modified.
Also, the cube definition in resources/cube.xml relies on a closure table
employee_closure that can be created using the following SQL:
CREATE TABLE employee_closure
( supervisor_id integer NOT NULL REFERENCES employees ( employee_id )
, employee_id integer NOT NULL REFERENCES employees ( employee_id )
, distance integer CHECK ( distance >= 0 )
, PRIMARY KEY ( supervisor_id , employee_id )
);
CREATE INDEX ON employee_closure ( employee_id );
WITH RECURSIVE closure ( supervisor_id , employee_id , distance ) AS
( SELECT employee_id , employee_id , 0 FROM employees
UNION ALL
SELECT closure.supervisor_id
, employees.employee_id
, distance + 1
FROM employees , closure
WHERE closure.employee_id = employees.reports_to
AND closure.distance = distance )
INSERT INTO employee_closure ( supervisor_id , employee_id , distance )
SELECT supervisor_id , employee_id , distance
FROM closure;
