PHPackages                             vasilisq/mdx-query-builder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vasilisq/mdx-query-builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vasilisq/mdx-query-builder
==========================

MDX Query Builder

1.0.1(6y ago)41.3k↓100%MITPHP

Since Feb 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/vasilisq/mdx-query-builder)[ Packagist](https://packagist.org/packages/vasilisq/mdx-query-builder)[ RSS](/packages/vasilisq-mdx-query-builder/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

MDX Query builder
=================

[](#mdx-query-builder)

Provides convenient query builder for MDX. Supports several features of Mondrian MDX specification.

Usage
-----

[](#usage)

Implement **ConnectionInterface** and pass it into **Query**.

You can use [Olap4Php](https://github.com/olap4php/olap4php) and pass MDX-string build by **Query** class into **XMLAStatement**.

An example of query can look like this:

```
$query = new Query($connection);

$dateRange = new DateRange(
    Carbon::parse('2019-01-01'),
    Carbon::parse('2019-01-31'),
    Period::DAY
);

$mdx = $query->select([
        '[Measures].[Retail Total]',
        '[Measures].[Profit]',
    ])
    ->by($dateRange)
    ->from('Sales')
    ->toMDX();
```

Resulting MDX is:

```
SELECT

{[Measures].[Retail Total], [Measures].[Profit]} ON COLUMNS,

{
    {[Time].[2019].[Q1].[1].[W1].[D1] : [Time].[2019].[Q1].[1].[W5].[D31]}
} ON ROWS

FROM [Sales]
```

TODO: Abstract Query class from Mondrian dialect

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Total

2

Last Release

2544d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b396be13a32673f2af0334c46a9182c11731de8765283ca2c3172dd4508e665?d=identicon)[vasilisq](/maintainers/vasilisq)

---

Top Contributors

[![vasilisq](https://avatars.githubusercontent.com/u/11678233?v=4)](https://github.com/vasilisq "vasilisq (18 commits)")[![jhaoda](https://avatars.githubusercontent.com/u/2151259?v=4)](https://github.com/jhaoda "jhaoda (1 commits)")

---

Tags

mdxmdxbuilderphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vasilisq-mdx-query-builder/health.svg)

```
[![Health](https://phpackages.com/badges/vasilisq-mdx-query-builder/health.svg)](https://phpackages.com/packages/vasilisq-mdx-query-builder)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
