Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
VGP
Contributor II
Contributor II

Qlik Sense Pivot-table

Hi All,

In mashup, I want to retrieve pivot table data using qlik sense api.  In qlik sense app, pivot table has one dimension and two measures with complex expressions.  I have tried using qHyperCubeDef, but it is not fetching data.

Thanks,

Guru

Labels (2)
4 Replies
ErikWetterberg

Did you remember qInitialDataFetch? Also remember that for a pivot table data is in qPivotDataPages.
VGP
Contributor II
Contributor II
Author

Yes ErikWetterberg, I have used qInitialDataFetch property and checked qPivotDataPages also. Below is sample JSON having complex expression, which i am using to get pivot table data . I have logged error in console and error message i am getting as "Object not found". Please tell me whether I am missing any property in qHyperCubeDef. var pvTable = {"qHyperCubeDef":{"qDimensions":[{"qLibraryId":null,"qDef":{"qFieldDefs":"complex expression"},"qLabel":"complex expression","qSortBy":{"qSortByState":0,"qSortByFrequency":0,"qSortByNumeric":0,"qSortByAscii":1,"qSortByLoadOrder":0,"qSortByExpression":0,"qExpression":{"qv":" "}}}],"qMeasures":[{"qLibraryId":null,"qDef":{"qDef":"complex expression"},"qLabel":"complex expression","qSortBy":{"qSortByState":0,"qSortByFrequency":0,"qSortByNumeric":0,"qSortByAscii":1,"qSortByLoadOrder":0,"qSortByExpression":0,"qExpression":{"qv":" "}}},{"qLibraryId":null,"qDef":{"qDef":"complex expression"},"qLabel":"complex expression","qSortBy":{"qSortByState":0,"qSortByFrequency":0,"qSortByNumeric":0,"qSortByAscii":1,"qSortByLoadOrder":0,"qSortByExpression":0,"qExpression":{"qv":" "}}}],"qMode":"P","qIndentMode":true,"qInitialDataFetch":[{"qHeight":2,"qWidth":10}],"qSuppressZero":false,"qSuppressMissing":false,"qNoOfLeftDims":1,"qInterColumnSortOrder":[-1,0],"qStateName":"$"}}; qlik.createGenericObject(pvTable, function(reply){ console.log(reply); }); Thanks, Guru
VGP
Contributor II
Contributor II
Author

Yes ErikWetterberg,

I have used qInitialDataFetch property and checked qPivotDataPages also. Below is sample JSON , which i am using to get pivot table data . I have logged error in console and error message i am getting as "Object not found". Please tell me whether I am missing any property in qHyperCubeDef.

 

var pvTable = {"qHyperCubeDef":{"qDimensions":[{"qLibraryId":null,"qDef":{"qFieldDefs":"complex expression"},"qLabel":"complex expression","qSortBy":{"qSortByState":0,"qSortByFrequency":0,"qSortByNumeric":0,"qSortByAscii":1,"qSortByLoadOrder":0,"qSortByExpression":0,"qExpression":{"qv":" "}}}],"qMeasures":[{"qLibraryId":null,"qDef":{"qDef":"complex expression"},"qLabel":"complex expression","qSortBy":{"qSortByState":0,"qSortByFrequency":0,"qSortByNumeric":0,"qSortByAscii":1,"qSortByLoadOrder":0,"qSortByExpression":0,"qExpression":{"qv":" "}}},{"qLibraryId":null,"qDef":{"qDef":"complex expression"},"qLabel":"complex expression","qSortBy":{"qSortByState":0,"qSortByFrequency":0,"qSortByNumeric":0,"qSortByAscii":1,"qSortByLoadOrder":0,"qSortByExpression":0,"qExpression":{"qv":" "}}}],"qMode":"P","qIndentMode":true,"qInitialDataFetch":[{"qHeight":2,"qWidth":10}],"qSuppressZero":false,"qSuppressMissing":false,"qNoOfLeftDims":1,"qInterColumnSortOrder":[-1,0],"qStateName":"$"}};

 

qlik.createGenericObject(pvTable, function(reply){
console.log(reply);
});

 

Thanks,

Guru

ErikWetterberg

I avoid using null in my json, try with '' instead.