We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.
All documentation
  • API Reference for older versions
  • sortValues

    sortValues(axisName: String, type: String, tuple: Array, measure: MeasureIdentifierObject)

    [starting from version: 1.4]

    Sorts a specific row or column in the compact form, the classic (tabular) form, and the chart view.

    Use the setFlatSort method for sorting in the flat form.

    Parameters

    Parameter/TypeDescription
    axisName
    String
    Specifies which axis should be sorted: rows ("rows") or columns ("columns").
    type
    String
    Specifies the sort order of a row or a column: ascending ("asc"), descending ("desc"), or unsorted ("unsorted").
    tuple
    String[]
    Members' unique names that identify a row or a column.
    measure
    MeasureIdentifierObject
    Specifies which measure from the slice should be sorted.

    Examples

    1) Sorting a specific column in ascending order:

    pivot.sortValues(
    "columns",
    "asc",
    ["category.[bikes]", "color.[red]"],
    {"uniqueName": "Price"}
    );

    Check out on JSFiddle.

    2) Remove sorting of a specific column:

    pivot.sortValues(
    "columns",
    "unsorted",
    ["category.[bikes]", "color.[red]"],
    {"uniqueName": "Price"}
    );

    See the full code on JSFiddle.

    See also

    getSort
    sortingMethod
    setSort