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(7y ago)41.3kMITPHP

Since Feb 27Pushed 7y 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 2w 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 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

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

2595d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11678233?v=4)[Andrey Vasilevskiy](/maintainers/vasilisq)[@vasilisq](https://github.com/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

[illuminate/support

The Illuminate Support package.

582110.9M40.0k](/packages/illuminate-support)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

292943.4k27](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

53675.5k16](/packages/solspace-craft-freeform)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40140.4k2](/packages/erlandmuchasaj-laravel-gzip)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

169.9k](/packages/japanese-date-japanese-date)[limingxinleo/hyperf-utils

Utils for Hyperf.

29136.4k3](/packages/limingxinleo-hyperf-utils)

PHPackages © 2026

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