Qlik Sense: Visualization API in a Pivot table returns bad parameters
Article Number: 000076642 | Last Modified: 2019/06/17
Description
When creating a dynamic table such a pivot table with three dimensions and two measures, and where one of these dimensions are on the right side with the measures, all of the dimensions will be moved to the left side after regenerating the pivot table when a measure is removed because qNoOfLeftDims is set to 3. Is this a bug or is something being implemented incorrectly?
Environments: Qlik Sense and Qlik Analytics Platform
Cause
The problem is that the Pivot table v2 extension was sending in a faulty qInterColumnSortOrder property to visualization.create. Even after removing the second measure, it was sending in [0, 1, 2, -1] for example, and the problem here is that the -1 should not be there since that is the pseudo dimension. This value ONLY exists when there are 2 or more measures.
Resolution
To fix this behavior, please add the following code:
var measureCount = 0; var measureCount = 0;
var pseudoDimensionIndex = options.qHyperCubeDef.qInterColumnSortOrder.indexOf(-1); angular.forEach($scope.selectedFields, function (item) { if(item.type === 'measure') { measureCount++; } });
Experiencing a serious issue, please contact us by phone. For Data Integration related issues please refer to your onboarding documentation for current phone number.