Bug in hierarchy member
When there's a hierarchy on rows/columns and drillAll is active
by juvian
HTML
<link rel="stylesheet" href="https://s3.amazonaws.com/flexmonster/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<form id="controls" class="controls">
<label><input type="radio" value="ordered" name="type">Ordered</label>
<label><input type="radio" value="unordered" name="type" checked>Unordered</label>
<button onclick="pivot.clear(); pivot.setReport(report); return false">Run</button>
</form>
<div id="pivot-container"></div>
CSS
.controls {
padding: 10px;
}
button {
margin-left: 10px;
}
JavaScript
let fields = {
"filters": {
"advanced": true,
"string": {
"members": true
}
},
"aggregations": {
"number": [
"sum",
"avg",
"min",
"max"
]
},
"fields": [
{
"uniqueName": "item.title",
"caption": "Título Publicación",
"type": "string"
},
{
"uniqueName": "sale.sales_amount",
"type": "number",
"caption": "Ventas $",
"metadata": {
"select": "sales_amount - COALESCE(LAG(sales_amount) over w, 0)"
}
},
{
"uniqueName": "sale.sales_amount_usd",
"type": "number",
"caption": "Ventas USD",
"aggregations": [
"sum"
],
"metadata": {
"select": "sales_amount_usd - COALESCE(LAG(sales_amount_usd) over w, 0)"
}
},
{
"uniqueName": "sale.units_sold",
"type": "number",
"caption": "Unidades Vendidas",
"metadata": {
"select": "units_sold - COALESCE(LAG(units_sold) over w, 0)"
}
},
{
"uniqueName": "item.price",
"caption": "Precio actual",
"type": "number"
},
{
"uniqueName": "item.brand_id",
"type": "string",
"caption": "Marca"
},
{
"uniqueName": "item.seller_id",
"type": "string",
"caption": "Vendedor"
},
{
"uniqueName": "item.category_id_1",
"type": "string",
"caption": "Categoria Nivel 1",
"filters": {
"members": true,
"advanced": true
},
"metadata": {
"tables": [
"item_new",
"category",
...