JSFiddle - React, Tailwind, and code Playground

HTML

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

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

JavaScript

var pivot = new Flexmonster({
	container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  width: "100%",
  height: 430,
  toolbar: true,
  report: {
    dataSource: {
      dataSourceType: "json",
      data: [
      {
      	"referral": "r1",
        "patient": "patient1",
        "own": 1,
        "active": 0,
        "age": 12
      },
      {
      	"referral": "r2",
        "patient": "patient1",
        "own": 0,
        "active": 1,
        "age": 35
      },
      {
      	"referral": "r3",
        "patient": "patient2",
        "own": 1,
        "active": 1,
        "age": 87
      },
      {
      	"referral": "r4",
        "patient": "patient3",
        "own": 0,
        "active": 1,
        "age": 2
      },
      ]
    },
    slice: {
      rows: [],
      columns: [{uniqueName: "[Measures]"}],
      measures: [
      {
      	"uniqueName": "uniquePatientCount",
        "formula": "distinctcount(\"patient\")",
      },
      {
      	"uniqueName": "uniqueOwnPatientCount",
        "formula": "distinctcount(\"patient\" ???(where 'own' == 1)???)",
      },
      {
      	"uniqueName": "uniqueActivePatientCount",
        "formula": "distinctcount(\"patient\" ???(where 'active' == 1)???)",
      },
      {
      	"uniqueName": "uniqueOwnActivePatientCount",
        "formula": "distinctcount(\"patient\" ???(where 'own' == 1 and 'active' == 1)???)",
      },
      {
      	"uniqueName": "uniqueAdultPatientCount",
        "formula": "distinctcount(\"patient\" ???(where 'age' > 18)???)",
      }
      ],
    }
  }
});