Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
See why Qlik is recognized as a Leader for the 10th year in a row – and discover how Qlik can help put your business in the lead. Get Report
Highlighted
VGP
New 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
Honored Contributor

Re: Qlik Sense Pivot-table

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

Re: Qlik Sense Pivot-table

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
Highlighted
VGP
New Contributor II

Re: Qlik Sense Pivot-table

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

Highlighted
ErikWetterberg
Honored Contributor

Re: Qlik Sense Pivot-table

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