Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
edwin
Master II
Master II

hyperCube sorting issue

Hi, i have a simple hyperCube with a couple of dimensions and measures.  i added a sorting number in the first column as there is a customized sort order depending on the dimensions being pulled.  the sort field is a unique number per row.

i first created a table in QS using the SORT column and its sorting as expected.

when i pulled the HC in a mashup, its not sorting accroding to the SORT column.  theis is my config:

 

{"qLabel": "TableSort","qLibraryId": "uGHpA","qNullSuppression": true,//"qOtherTotalSpec": {"qOtherMode": "OTHER_OFF","qSuppressOther": true,"qOtherCounted": {"qv": "5"},"qOtherLimitMode": "OTHER_GE_LIMIT"}, 
					"qSortCriterias": [{"qSortByState": 0,"qSortByFrequency": 0,"qSortByNumeric": 1,"qSortByAscii": 0,"qSortByLoadOrder": 0,}]},

 

 

ive tried a combination of sort by number and sort by ascii - doesnt work as expected,  in the create cube call, ive tried different combinations with the intercolumn sort order but i cant figure out what it is sorting by:

 

App.createCube({
            		"qInitialDataFetch": [{"qTop": TopRow,"qHeight": Height,"qWidth": (Dimensions.length + Measures.length)}],
            		"qDimensions": Dimensions,
            		"qMeasures":  Measures,
            		"qSuppressZero": false,"qSuppressMissing": false,"qMode": "S","qInterColumnSortOrder": [0],"qStateName": "$"

 

 

has anyone experienced this problem and solved it?  if you have, what did you do? 

thanks,

edwin

Labels (2)
11 Replies
edwin
Master II
Master II
Author

hi Alex
thanks for the swift reply.  the attached example has inter column sort order as 0,1,2,3.  even the first dimension isnt sorting properly.  the dimensions are sorted by default - other ascending:

{"qDef": {"qFieldDefs": ["province"]},
			"qNullSuppression": true,"qOtherTotalSpec": {"qOtherMode": "OTHER_OFF","qSuppressOther": true,"qOtherSortMode": "OTHER_SORT_ASCENDING","qOtherCounted": {"qv": "5"},"qOtherLimitMode": "OTHER_GE_LIMIT"}
		},
		{"qDef": {"qFieldDefs": ["region"]},
			"qNullSuppression": true,"qOtherTotalSpec": {"qOtherMode": "OTHER_OFF","qSuppressOther": true,"qOtherSortMode": "OTHER_SORT_ASCENDING","qOtherCounted": {"qv": "5"},"qOtherLimitMode": "OTHER_GE_LIMIT"}
		},
		{"qDef": {"qFieldDefs": ["city"]},
			"qNullSuppression": true,"qOtherTotalSpec": {"qOtherMode": "OTHER_OFF","qSuppressOther": true,"qOtherSortMode": "OTHER_SORT_ASCENDING","qOtherCounted": {"qv": "5"},"qOtherLimitMode": "OTHER_GE_LIMIT"}
		},
		{
			"qDef": {"qFieldDefs": ["indicator_code"]},
			"qNullSuppression": true,"qOtherTotalSpec": {"qOtherMode": "OTHER_OFF","qSuppressOther": true,"qOtherSortMode": "OTHER_SORT_DESCENDING","qOtherCounted": {"qv": "5"},"qOtherLimitMode": "OTHER_GE_LIMIT"}
		}


"qMeasures": [
		{"qLabel": "Measure","qLibraryId": "LbjVGw",
			"qSortBy": {"qSortByState": 0,"qSortByFrequency": 0,"qSortByNumeric": 0,"qSortByAscii": 1,"qSortByLoadOrder": 0,"qSortByExpression": 0,"qExpression": {"qv": " "}}
		}
	],
	"qSuppressZero": false,	"qSuppressMissing": false,	"qInterColumnSortOrder": [0,1,2,-3],	"qStateName": "$","qMode": "P","qAlwaysFullyExpanded": true, "qNoOfLeftDims": 3
	},tmp);
alex_colombo
Employee
Employee

No I'm sorry, I'm not following. You've uploaded an app with a pivot table with all dimensions sorted by default (it means your values will be sorted by ascii asc if they are strings, by numberically desc if they are numbers).

Why you are saying that first dimension is not sorted correctly? It is sorted by ascii asc correctly.

Please could you provide me the expected sorting behaviour with an example with data?