Web pivot tables by XMLA OLAP Data Source Setup


Cube schema is specified in the appsettings.json file PivotDataService:Cubes section.

Cube config for XMLA OLAP should have "SourceType": "xmla" and an additional "SourceXmla" section:

{
  "Id": "xmla-cube-test",
  "Name": "XMLA Test",
  "SourceType": "xmla",
  "SourceXmla": {
    "ConnectionString": "Data Source=http://localhost/olap/msmdpump.dll;Initial Catalog=Adventure Works DW Standard Edition;Connect Timeout=30;User ID=;Password=;",
    "SelectMdx": "SELECT @AXES FROM @CUBE",  // @AXES token is generated by the report, and @CUBE is defined below
    "MdxTokens": [
      {
        "Name": "CUBE",
        "Expression": "SelectFromCube(\"Adventure Works\").Where(\"[Geography].[Geography].[Country]\", country).Where(\"[Product].[Category]\", category)"
      }
    ]    
  },
  "PivotFilter": {
    "ApplyAsCondition": true
  },
  "Dimensions": [
    {
      "Name": "[Date].[Fiscal Year].[MEMBER_VALUE]",
      "LabelText":  "Date (Year)"
    },
    {
      "Name": "[Date].[Month of Year].[MEMBER_VALUE]",
      "LabelText":  "Date (Month)"
    },
    {
      "Name": "[Geography].[Geography].[Country]",
      "Params": [ "{[Geography].[Geography].[Country].members, [Geography].[Geography].[All Geographies]}" ],
      "LabelText": "Country"
    },
    {
      "Name": "[Product].[Category]",
      "Params": [ "{[Product].[Category].members, [Product].[Category].[All Products]}" ],
      "LabelText": "Product Category"
    },
    {
      "Name": "[Product].[Product Model Lines].[Product Line]",
      "LabelText": "Product Line"
    }
  ],
  "Measures": [
    {
      "Type": "FirstValue",
      "Params": [ "[Measures].[Order Count]" ],
      "LabelText": "Order Count"
    },
    {
      "Type": "FirstValue",
      "Params": [ "[Measures].[Sales Amount]" ],
      "LabelText": "Sales Amount"
    }
  ],
  "Parameters": [
    {
      "Name": "country",
      "Multivalue": true
    },
    {
      "Name": "category",
      "Multivalue": true
    }
  ]
}

"ConnectionString" specifies XMLA endpoint connection properties for ADOMD.NET driver.
Note: .NET Core builds support only HTTP(S)-based data sources (including 'asazure:')

Dimensions

Dimension name should refer to the OLAP cube dimension attribute. As a name suffix you can specify concrete dimension property to load: [MEMBER_CAPTION], [MEMBER_NAME], [MEMBER_VALUE], [MEMBER_UNIQUE_NAME]. If property is not specified MEMBER_CAPTION is loaded by default.

Optionally, you can specify custom MDX expression for set that returns the dimension attribute (in "Params" section).

Measures

In XMLA connector only 2 measure types are supported FirstValue and Expression. For FirstValue "Params" section should be defined with OLAP cube measure specifier.

Parameters

Report parameter may be used in "SelectMdx" and "Expression" of the "MdxTokens" entries. To simplify generation of the MDX slicer it is recommended to apply parameters with help of Where function; it is safe and prevents possible MDX-injections.