Nested Row Hierarchy Drill Down
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>
<!--
1. We can drill all the way through the Item and Test
hierarchy independently of each other, but not
together.
2. Drill through "Color" in any row
3. Drill through "Size" from any of the resulting rows from step 2
4. Expand out any of the resulting rows from step 3
5. Drill through "Business Type" from the resulting row in step
* At this point, we can't drill through "Business Type"
despite it having the "Discount" level that has yet to
be shown
-->
JavaScript
var why = 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",
"mapping": {
"Category": {
"type": "string",
hierarchy: "Item"
},
"Color": {
"type": "string",
hierarchy: "Item",
parent: "Category"
},
"Size": {
"type": "string",
hierarchy: "Item",
parent: "Color"
},
"Destination": {
"type": "string",
hierarchy: "Test"
},
"Business Type": {
"type": "string",
hierarchy: "Test",
parent: "Destination"
},
"Discount": {
"type": "number",
hierarchy: "Test",
parent: "Business Type"
}
}
},
"slice": {
"rows": [
{
"uniqueName": "Country"
},
{
"uniqueName": "[Item]",
},
{
"uniqueName": "[Test]",
},
],
"columns": [{
"uniqueName": "[Measures]"
}],
"measures": [{
"uniqueName": "Price",
"aggregation": "sum"
}],
"expands": {
"rows": [{
"tuple": [
"Country.[Australia]"
]
}]
}
}
}
});