Test wrong column summarization
Slice configuration
HTML
<link rel="stylesheet" href="https://cdn.flexmonster.com/2.3/demo.css">
<script src="https://cdn.flexmonster.com/flexmonster.js"></script>
<p>
It is obvious, that the summarization of columns should not be calculated by multiplying the sums of other columns but by aggregating the cells in the given column. The summarization should not calculate itself, it should summarize.
</p>
<div id="pivot-container"></div>
CSS
.output {
width: 80%;
height: 300px;
margin-left: auto;
margin-right: auto;
padding: 20px;
background: rgba(242, 242, 242, 1);
font-family: Menlo, Monaco, "Courier New", Courier, monospace;
white-space: pre;
font-size: 16px;
font-weight: 400;
overflow-y: scroll;
margin-top: 20px;
}
code {
font-size: 105%;
color: #DF3800;
background-color: #f5f5f5;
padding: 1px 4px;
font-family: monospace !important;
border-radius: 4px;
}
p {
font-size: 15px;
line-height: 1.5;
padding-right: 10px;
padding-left: 10px;
}
a {
color: #00a45a;
text-decoration: none;
}
button {
margin-left: 10px;
}
JavaScript
const pivot = new Flexmonster({
container: "pivot-container",
componentFolder: "https://cdn.flexmonster.com/",
report: {
options: {
grid: {
type: "flat",
},
},
slice: {
columns: [
{
uniqueName: "[Measures]",
},
],
rows: [
{
uniqueName: "Activity",
},
{
uniqueName: "FormattedQuantity",
},
],
measures: [
{
uniqueName: "Price",
},
{
uniqueName: "Total",
formula: '"Quantity" * "Price"',
},
],
},
dataSource: {
mapping: {
EstimateId: {
type: "id",
caption: "Identifier",
},
Activity: {
type: "string",
caption: "Activity",
},
FormattedQuantity: {
type: "string",
caption: "Quantity (piece)",
},
Quantity: {
type: "number",
caption: "Quantity",
},
Price: {
type: "number",
caption: "Price",
},
},
data: [
{
token:
"ddd",
dataType: "rational",
EstimateId: "6ebf61e2-af87-4f37-8aa9-08dd866759a3",
Activity: "Create documentation",
FormattedQuantity: "2 pieces",
Quantity: 2,
Price: 2,
},
{
token:
"vvv",
dataType: "rational",
EstimateId: "227efe3e-68e4-4504-8aaa-08dd866759a3",
Activity: "3D flyover video",
FormattedQuantity: "1 piece",
Quantity: 1,
Price: 1,
},
],
},
},
})