0 Replies Latest reply: Jul 10, 2017 1:19 AM by Sourodeep Banerjee RSS

    Paging Data from Hypercube

    Sourodeep Banerjee

      Hi ,

       

      We have a req to build get data from a hypercube, the base dataset contains around 5000 rows .Using the Mashup API we are able to get all the rows in one go, but we want to get the data in pages so as to improve performance of the webpage.

       

      If anyone has done this using the mashup api please suggest.

       

       

      Thanks.

       

      Here's the code we are using  to get data

       

      app.createCube({

      "qInitialDataFetch": [

      {

      "qTop":0

      "qHeight": height,

      "qWidth": 2

      }

      ],

      "qDimensions": [

      {

      "qDef": {

      "qFieldDefs": [

      "time_key"

      ]

      },

      "qNullSuppression": true,

      "qOtherTotalSpec": {

      "qOtherMode": "OTHER_OFF",

      "qSuppressOther": true,

      "qOtherSortMode": "OTHER_SORT_DESCENDING",

      "qOtherCounted": {

      "qv": "5"

      },

      "qOtherLimitMode": "OTHER_GE_LIMIT"

      }

      }

      ],

      "qMeasures": [

      {

      "qDef": {

      "qDef": "count(post_id)"

      },

      "qLabel": "count(post_id)",

      "qLibraryId": null,

      "qSortBy": {

      "qSortByState": 0,

      "qSortByFrequency": 0,

      "qSortByNumeric": 0,

      "qSortByAscii": 1,

      "qSortByLoadOrder": 0,

      "qSortByExpression": 0,

      "qExpression": {

      "qv": " "

      }

      }

      }

      ],

      "qSuppressZero": true,

      "qSuppressMissing": true,

      "qMode": "S",

      "qInterColumnSortOrder": [],

      "qStateName": "$"

      },callTimeKey);

       

       

       

       

      function callTimeKey(reply){

       

       

      var valueDimension = [];

       

      var valueMea = [];

       

      console.log(reply);

       

      $.each(reply.qHyperCube.qDataPages[0].qMatrix,function(index,value){

       

      valueDimension.push(this[0].qNum);

      valueMea.push(this[1].qNum);

      });

       

       

      $.each(valueDimension,function(index,value){

      console.log(valueDimension[index]);

      });

       

      $.each(valueMea,function(index,value){

      console.log(valueMea[index]);

      });

       

      }