Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Paging Data from Hypercube

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]);

});

}

0 Replies