All Projects → fibo → OLAP-cube

fibo / OLAP-cube

Licence: MIT license
is an hypercube of data

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to OLAP-cube

Guitar
A Simple and Efficient Distributed Multidimensional BI Analysis Engine.
Stars: ✭ 86 (+273.91%)
Mutual labels:  business-intelligence, olap, olap-cube
pivot-react
Integration example of WebDataRocks web reporting tool with React framework
Stars: ✭ 33 (+43.48%)
Mutual labels:  pivot-tables, pivot
Cboard
An easy to use, self-service open BI reporting and BI dashboard platform.
Stars: ✭ 2,795 (+12052.17%)
Mutual labels:  business-intelligence, olap
Tablereport
A python library for making table report.
Stars: ✭ 51 (+121.74%)
Mutual labels:  table, report
spark-druid-olap
Sparkline BI Accelerator provides fast ad-hoc query capability over Logical Cubes. This has been folded into our SNAP Platform(http://bit.ly/2oBJSpP) an Integrated BI platform on Apache Spark.
Stars: ✭ 286 (+1143.48%)
Mutual labels:  business-intelligence, olap-cube
prosto
Prosto is a data processing toolkit radically changing how data is processed by heavily relying on functions and operations with functions - an alternative to map-reduce and join-groupby
Stars: ✭ 54 (+134.78%)
Mutual labels:  business-intelligence, olap
Jqgrid
jQuery grid plugin
Stars: ✭ 2,803 (+12086.96%)
Mutual labels:  table, pivot-tables
compareGroups
R package to easily build publication-ready univariate or bivariate descriptive tables from a data set.
Stars: ✭ 23 (+0%)
Mutual labels:  table, report
PivotHelper
PivotHelper is a utility web app that generates Pivot tables and charts from CSV files and Microsoft Excel spreadsheets.
Stars: ✭ 26 (+13.04%)
Mutual labels:  pivot-tables, pivot
NBi
NBi is a testing framework (add-on to NUnit) for Business Intelligence and Data Access. The main goal of this framework is to let users create tests with a declarative approach based on an Xml syntax. By the means of NBi, you don't need to develop C# or Java code to specify your tests! Either, you don't need Visual Studio or Eclipse to compile y…
Stars: ✭ 102 (+343.48%)
Mutual labels:  business-intelligence, cube
pivot-angular
Integration example of WebDataRocks web reporting tool with Angular 2+ framework
Stars: ✭ 30 (+30.43%)
Mutual labels:  pivot-tables, pivot
autopivot
AutoPivot automatically creates in-memory OLAP cubes from CSV files, that you can explore from Excel, Tableau or using the embedded ActiveUI web frontend
Stars: ✭ 23 (+0%)
Mutual labels:  olap, cube
S2
⚡️ Practical analytical Table rendering core lib.
Stars: ✭ 818 (+3456.52%)
Mutual labels:  table, pivot-tables
Mining
Business Intelligence (BI) in Python, OLAP
Stars: ✭ 1,128 (+4804.35%)
Mutual labels:  business-intelligence, olap
React Virtualized Pivot
React Virtualized Pivot
Stars: ✭ 95 (+313.04%)
Mutual labels:  table, pivot-tables
datart
Datart is a next generation Data Visualization Open Platform
Stars: ✭ 1,042 (+4430.43%)
Mutual labels:  business-intelligence, report
Real-time-Data-Warehouse
Real-time Data Warehouse with Apache Flink & Apache Kafka & Apache Hudi
Stars: ✭ 52 (+126.09%)
Mutual labels:  data-warehouse, data-warehousing
index-autoload
Adds an index to the autoload in wp_options table and verifies it exists on a daily basis (using WP Cron), resulting in a more efficient database.
Stars: ✭ 18 (-21.74%)
Mutual labels:  table
tabularray
Typeset tabulars and arrays with LaTeX3
Stars: ✭ 101 (+339.13%)
Mutual labels:  table
QuestPDF
QuestPDF is an open-source, modern and battle-tested library that can help you with generating PDF documents by offering friendly, discoverable and predictable C# fluent API.
Stars: ✭ 2,872 (+12386.96%)
Mutual labels:  report

OLAP-cube

is an hypercube of data

Description | Installation | API | License

NPM version Build Status JavaScript Style Guide

Description

An OLAP cube is a multidimensional array of data you can explore and analyze. Here you will find an engine that could feed a graphic viewer.

Installation

Using npm

With npm do

npm install olap-cube

Using a CDN

Add this to your HTML page

<script src="https://unpkg.com/olap-cube/dist/olap-cube.min.js"></script>

API

All code in this section is run and tested in this single file. Note also that

  1. Everything is immutable, all attributes are static.
  2. Operators are chainable and they always return a brand new instance.

new Table({ dimensions, fields, points, data })

  • @param {Object} arg
  • @param {Array} arg.dimensions
  • @param {Array} arg.points
  • @param {Array} arg.fields
  • @param {Array} arg.data in the format data[pointIndex][fieldIndex]
const Table = require('olap-cube').model.Table

const table = new Table({
  dimensions: ['year', 'month'],
  fields: ['revenue'],
  points: [[2016, 'Jan']],
  data: [[100]]
})

console.log(table) // Table {
                   //   dimensions: ['year', 'month'],
                   //   fields: ['revenue']
                   // }

table.structure

Attribute structure holds necessary information to clone a table excluding its data.

Create an empty table

const emptyTable = new Table(table.structure)

table.dimensions

The (hyper)cube dimensions.

One common dimension in Business Intelligence is time: it can have different granularities, like year, month, day, etc.

console.log(table.dimensions) // [ 'year', 'month' ]

table.fields

The names of the data fields.

console.log(table.fields) // [ 'revenue' ]

table.header

Attribute header concatenates dimension names and field names.

console.log(table.header) // ['year', 'month', 'revenue']

table.addRows({ header: [key1, key2, ...], rows: [row1, row2, ...]})

Add a set of rows to the table.

  • @param {Object} data
  • @param {Array} data.header
  • @param {Array} data.rows
  • @returns {Object} table

Every row is an object which attributes are either a dimension or a field.

const table2 = emptyTable.addRows({
  header: ['year', 'month', 'revenue'],
  rows: [
    [ 2015, 'Nov', 80 ],
    [ 2015, 'Dec', 90 ],
    [ 2016, 'Jan', 100 ],
    [ 2016, 'Feb', 170 ],
    [ 2016, 'Mar', 280 ],
    [ 2017, 'Feb', 177 ],
    [ 2017, 'Apr', 410 ]
  ]
})

table.data

Attribute data holds the facts of the table.

console.log(table2.data) // [[ 80 ],
                         //  [ 90 ],
                         //  [ 100 ],
                         //  [ 170 ],
                         //  [ 280 ],
                         //  [ 177 ],
                         //  [ 410 ]]

table.rows

Attribute rows holds the dimensions and the facts of the table.

console.log(table2.rows) // [[ 2015, 'Nov', 80 ],
                         //  [ 2015, 'Dec', 90 ],
                         //  [ 2016, 'Jan', 100 ],
                         //  [ 2016, 'Feb', 170 ],
                         //  [ 2016, 'Mar', 280 ],
                         //  [ 2017, 'Feb', 177 ],
                         //  [ 2017, 'Apr', 410 ]]

table.points

The points are an ordered set of coordinates.

In this case you can see 6 points with coordinates:

  1. year
  2. month
console.log(table2.points) // [[ 2015, 'Nov' ],
                           //  [ 2015, 'Dec' ],
                           //  [ 2016, 'Jan' ],
                           //  [ 2016, 'Feb' ],
                           //  [ 2016, 'Feb' ],
                           //  [ 2017, 'Apr' ]]

table.slice(dimension, filter)

Slice operator picks a rectangular subset of a cube by choosing a single value of its dimensions.

  • @param {String} dimension
  • @param {*} filter
  • @returns {Object} table

Consider the following example, where a slice with 2016 year is created.

const table3 = table2.slice('year', 2016)

console.log(table3.points) // [[ 2016, 'Jan' ],
                           //  [ 2016, 'Feb' ],
                           //  [ 2016, 'Mar' ]]

console.log(table3.data) // [[ 100 ],
                         //  [ 170 ],
                         //  [ 280 ]]

table.dice(selector)

Dice operator picks a subcube by choosing a specific values of multiple dimensions.

  • @param {Function} selector
  • @returns {Object} table

Consider the following example, where a dice excluding one month is created.

const onlyFebruary = (point) => point[1] !== 'Feb'

const table4 = table2.dice(onlyFebruary)

console.log(table4.points) // [[ 2015, 'Nov' ],
                           //  [ 2015, 'Dec' ],
                           //  [ 2016, 'Jan' ],
                           //  [ 2016, 'Mar' ],
                           //  [ 2017, 'Apr' ]]

console.log(table4.data) // [[ 80 ],
                         //  [ 90 ],
                         //  [ 100 ],
                         //  [ 280 ],
                         //  [ 410 ]]

table.rollup(dimension, fields, aggregator, initialValue)

A roll-up involves summarizing the data along a dimension. The summarization rule might be computing totals along a hierarchy or applying a set of formulas such as "profit = sales - expenses".

  • @param {String} dimension
  • @param {Array} fields
  • @param {Function} aggregator
  • @param {*} initialValue that will be passed to Array.prototype.reduce().
  • @returns {Object} table
const table5 = new Table({
  dimensions: ['continent', 'country'],
  fields: ['numStores']
})

// NOTA BENE: Remember that tables are immuTables ☺.
const table6 = table5.addRows({
  header: [ 'continent', 'country', 'numStores' ],
  rows: [
    [ 'Europe', 'Norway', 20 ],
    [ 'Europe', 'Denmark', 48 ],
    [ 'Europe', 'Germany', 110 ],
    [ 'Europe', 'Portugal', 17 ],
    [ 'Asia', 'China', 280 ],
    [ 'Asia', 'Russia', 161 ],
    [ 'Asia', 'Thailand', 120 ]
  ]
})

// Input tables and rolled up table has only one field,
// with the same name: numStores.
// Actually the aggregator is a reducer that will receive in input an
// array of fields from the input table, and will output an array of
// fields to the rolled up table.
const summation = (sum, value) => {
  return [sum[0] + value[0]]
}

const initialValue = [0]

const table7 = table6.rollup('continent', ['numStores'], summation, initialValue)

console.log(table7.rows) // [[ 'Europe', 195 ],
                         //  [ 'Asia', 561 ]]

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].