Filter issue
by inunziante
HTML
<link rel="stylesheet" href="https://cdn.flexmonster.com/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<button onclick="expandAll()">Expand all</button>
<button onclick="collapseAll()">Collapse all</button>
<div id="pivot-container"></div>
JavaScript
var data = [{
"RowId": "1_1",
"Product": "Product 1",
"Channel": "Channel 1",
"Quantity1": 1,
"Month": "feb23",
"Year": "2023"
},
{
"RowId": "1_2",
"Product": "Product 1",
"Channel": "Channel 2",
"Quantity1": 1,
"Quantity2": 100,
"Month":"feb23",
"Year": "2023"
},
{
"RowId": "2_1",
"Product": "Product 2",
"Channel": "Channel 1",
"Quantity1": 2,
"Quantity2": 200,
"Month": "feb23",
"Year": "2023"
},
{
"RowId": "2_2",
"Product": "Product 2",
"Channel": "Channel 2",
"Quantity2": 400,
"Month": "feb23",
"Year": "2023"
}
];
var pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
width: "100%",
height: 430,
report: {
"dataSource": {
"type": "json",
"data": data,
"mapping": {
"RowId": {
"type": "id"
},
"Product": {
"type": "string"
},
"Channel": {
"type": "string"
},
"Month": {
"type": "string",
"hierarchy": "Bucket",
"parent": "Year"
},
"Year": {
"type": "string",
"hierarchy": "Bucket"
},
"Quantity1": {
"type": "number"
},
"Quantity2": {
"type": "number"
}
}
},
"slice": {
"rows": [{
"uniqueName": "Channel",
}, {
"uniqueName": "Product",
}, {
"uniqueName": "[Measures]"
}],
"columns": [{
"uniqueName": "Bucket"
}],
"measures": [{
"uniqueName": "Quantity1"
}
]
}
}
});
function expandAll() {
flexmonster.expandAllData();
}
function collapseAll() {
flexmonster.collapseAllData();
}