Show member properties (attribute relationships)

Options

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div>
  <h2>How to show member properties (attribute relationships)</h2>
  <p>
    If member properties (also known as attribute relationships) are defined in
    your OLAP cube, Flexmonster can show them on the grid.
  </p>
  <p>
    To load your data along with member properties, set the
    <a
      href="https://www.flexmonster.com/api/options-object/#showMemberProperties"
      target="_blank"
    >showMemberProperties</a> option to <code>true</code>. As a result, you'll 
    be able to access member properties through the context menu. Select the
    <strong>Properties</strong> context menu item and choose member properties
    to show on the grid.
  </p>
  <p>
    You can also predefine which member properties to show by setting the
    <a
      href="https://www.flexmonster.com/api/slice-object/#memberproperties"
      target="_blank"
    >slice.memberProperties</a> property.
  </p>
</div>

<button onclick="showMemberProperties(false)">Hide member properties</button>
<button onclick="showMemberProperties(true)">Show member properties</button>

<div id="pivot-container"></div>

CSS

@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);

JavaScript

const pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  toolbar: true,
  report: {
    dataSource: {
      type: "microsoft analysis services",
      proxyUrl: "https://olap.flexmonster.com/olap/msmdpump.dll",
      catalog: "Adventure Works DW Standard Edition",
      cube: "Adventure Works",
    },
    slice: {
      rows: [
        {
          uniqueName: "[Reseller].[Reseller]",
          sort: "asc",
        },
      ],
      columns: [
        {
          uniqueName: "[Measures]",
        },
      ],
      measures: [
        {
          uniqueName: "[Measures].[Reseller Order Count]",
          aggregation: "none",
          active: true,
        },
        {
          uniqueName: "[Measures].[Discount Amount]",
          aggregation: "none",
          active: true,
        },
      ],
      memberProperties: [
        {
          levelName: "[Reseller].[Reseller].[Reseller]",
          properties: ["Bank Name", "Address", "Phone"],
        },
      ],
    },
    options: {
      showMemberProperties: true,
    },
  },
});

function showMemberProperties(value) {
  let report = pivot.getReport({ withDefaults: true });
  report.options.showMemberProperties = value;
  pivot.setReport(report);
}