Population Standard Deviation and Sample Standard Deviation aggregations

Slice configuration

by Flexmonster Pivot Table

HTML

<script src="https://cdn.flexmonster.com/flexmonster.js"></script>

<div>
  <p>
    In this example, the <code>"stdevp"</code> and
    <code>"stdevs"</code> aggregations are used to calculate the population
    standard deviation and the sample standard deviation for prices depending on
    a country and a color.
  </p>
  <p>
    Read more about the
    <a
      target="_blank"
      href="https://www.flexmonster.com/doc/aggregation-functions/#population-stdev"
      >"stdevp"</a
    >
    and
    <a
      target="_blank"
      href="https://www.flexmonster.com/doc/aggregation-functions/#sample-stdev"
      >"stdevs"</a
    >
    aggregations in Flexmonster docs.
  </p>
</div>

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

CSS

@import url(https://cdn.flexmonster.com/assets/jsfiddle-styles.css);

JavaScript

const pivot = new Flexmonster({
  container: "pivot-container",
  componentFolder: "https://cdn.flexmonster.com/",
  report: {
    dataSource: {
      data: getData()
    },
    slice: {
      rows: [{
        uniqueName: "Country"
      }, {
        uniqueName: "[Measures]"
      }],
      columns: [{
        uniqueName: "Color"
      }],
      measures: [{
        uniqueName: "Price",
        aggregation: "stdevp"
      }, {
        uniqueName: "Price",
        aggregation: "stdevs"
      }]
    },
    formats: [{
      name: "",
      decimalSeparator: ".",
      decimalPlaces: 2,
      nullValue: "-"
    }]
  }
});

function getData() {
  return [
    {
      "Color" : "green",
      "Country" : "Canada",
      "City" : "Toronto",
      "Price" : 174,
      "Quantity" : 22
    },
    {
      "Color" : "red",
      "Country" : "USA",
      "City" : "Los Angeles",
      "Price" : 166,
      "Quantity" : 19
    },
    {
      "Color" : "blue",
      "Country" : "USA",
      "City" : "Tallahassee",
      "Price" : 215,
      "Quantity" : 25
    },
    {
      "Color" : "black",
      "Country" : "Canada",
      "City" : "Montreal",
      "Price" : 194,
      "Quantity" : 15
    },
    {
      "Color" : "red",
      "Country" : "Canada",
      "City" : "Montreal",
      "Price" : 123,
      "Quantity" : 12
    },
    {
      "Color" : "blue",
      "Country" : "Canada",
      "City" : "Toronto",
      "Price" : 189,
      "Quantity" : 31
    },
    {
      "Color" : "black",
      "Country" : "USA",
      "City" : "New York",
      "Price" : 312,
      "Quantity" : 32
    },
    {
      "Color" : "black",
      "Country" : "USA",
      "City" : "New York",
      "Price" : 246,
      "Quantity" : 21
    },
    {
      "Color" : "black",
      "Country" : "Canada",
      "City" : "Ontario",
      "Price" : 241,
      "Quantity" : 20
    },
    {
      "Color" :...