0 Replies Latest reply: Jul 3, 2017 10:16 AM by Maite Jonas RSS

    Sort values into hypercube

    Maite Jonas

      Dear all,

       

      I’m trying to sort my data with a hypercube. The final aim is to have a table ordered by value like this (example) :

      Variable 1 (Dimension)

      Variable 2 (Measure 1)

      Variable 3 (Measure 2)

      Variable 4 (Measure 3)

      Name 1

      50

      1

      100

      Name 2

      90

      2

      150

      Name 3

      20

      3

      3

       

      I’m able to sort the table based on Variable1 (dimension) or on Variable2 (first measure into the hypercube) thanks to “qInterColumnSortOrder” :

      - If it equal to [0,1], values are sorted based on dimensions (therefore, based on Variable 1).

      - If it equal to [1,0], values are sorted based on measures (therefore, based on Measure 1).

      How can I do if I want to sort my data based on the second measure and not based on the first measure?

       

      Thanks in advance for your answers

       

      To obtain this, my hypercube is constructed like this :

       

      app.createCube({

        qDimensions : [

            {qDef : {

            "qFieldDefs": Variable1},

            qOtherTotalSpec : {

            "qOtherSortMode": "OTHER_SORT_ASCENDING"}

            }

            ],

        qMeasures : [

          {qDef : {

            qDef : Variable2 Equation},

            qLabel : "sel_0",

            qSortBy : {"qSortByNumeric": -1}},

          {qDef : {

            qDef : Variable3 Equation},

            qLabel : "sel_1",

            qSortBy : {"qSortByNumeric": -1}},

          {qDef : {

            qDef : Variable4 Equation},

            qLabel : "sel_2",

            qSortBy : {"qSortByNumeric": -1}}

          ],

        qInterColumnSortOrder : [0,1],

        qInitialDataFetch : [{

          qHeight : q_height,

         qWidth : q_width}]

        }, function(reply) { /*-- Construction of table --*/ }