Filtering Calculated Values

Demos

HTML

<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>


<!-- 
  1. Click on the "COLOR" Report Filter
  2. Filter by: Values
  3. Switch the value from "Sum of Price" to "My Calculation"
    * Optionally change the filter condition and filter value
  4. An error occurs, presumably because "My Calculation" is not a known
     field 
-->
<div id="pivot-container"></div>

JavaScript

new Flexmonster({
  container: "#pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "100%",
  height: 550,
  toolbar: true,
  report: {
    "dataSource": {
      "type": "api",
      "url": "https://olap.flexmonster.com:9500",
      "index": "fm-product-sales"
    },
    "slice": {
      "rows": [{
        "uniqueName": "Category"
      }],
      "columns": [{
          "uniqueName": "Color"
        },
        {
          "uniqueName": "[Measures]"
        }
      ],
      "measures": [
        {
          "uniqueName": "Price",
          "aggregation": "sum"
        },
         {
        "uniqueName": "My Calculation",
        "caption": "My Calculation",
        "grandTotalCaption": "My Calculation",
        "formula": "count(\"Business Type\") + count(\"Category\")",
      },
      ]
    }
  }
});