Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 2.23 KB

README.md

File metadata and controls

66 lines (46 loc) · 2.23 KB

Alamdx - JavaScript MDX OLAP library for Alasql database

Version 0.0.0 Date 23.11.2014 Changelog, Release Plan

Alamdx - 'à la MDX' - is a light-weight JavaScript client-side MDX OLAP database library designed to work in browser and Node.js. It is an extension for Alasql database.

Alamdx realizes a subset of MDX (a language for multidimensional expressions) and designed for development of browser and mobile reporting and analytical applications, online analytical processing (OLAP), multidimensional analysis and work with aggregated data.

Warning

Works in progress...

How to use

In browser

    <script src="alasql.js"></script>
    <script src="alamdx.js"></script>
    <script>
    	// Prepare the data cube
    	alasql('create table sales (fruit string, country string, qty int)');
    	alasql('insert into sales values ("Apple","Argentina",1500)');
    	alasql('insert into sales values ("Apple","Mexica",1500)');
    	alasql('insert into sales values ("Melon","Argentina",250)');
    	alasql('insert into sales values ("Melon","Mexica",250)');
    	// Execute MDX statement
    	var res = alamdx('SELECT [Measures].[qty] ON COLUMNS, [fruit] ON ROWS FROM sales');
    </string>

AMD / require

	require(['alamdx'], function(alamdx) {
		var alasql = alamdx.alasql;
    	alasql('create table sales (fruit string, country string, qty int)');
    	alasql('insert into sales values ("Apple","Argentina",1500)');
    	var res = alamdx('SELECT [Measures].[qty] ON COLUMNS, [fruit] ON ROWS FROM sales');
	});

In Node.js

	var alamdx = require('alamdx');
	var alasql = alamdx.alasql;

	alasql('create table sales (fruit string, country string, qty int)');
	alasql('insert into sales values ("Apple","Argentina",1500)');
	var res = alamdx('SELECT [Measures].[qty] ON COLUMNS, [fruit] ON ROWS FROM sales');

MDX Language (multidimensional expressions)

  • WITH {} SELECT {} ON COLUMNS, {} ON ROWS FROM cube WHERE slice
  • Create cube
  • Create dimension
  • Create calculation

License

(c) 2014, Andrey Gershun MIT license information