Qlik Community

Integration, Extension & APIs

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

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
salezian
Creator
Creator

Sorting HyperCube

Dear Qlik Fans,

I'm struggling to get sorted alphabetically table in my mashup project. 

I'm using following piece of code to get qTable object:

$scope.table=app.createTable([{'qDef':{'qFieldDefs':['Absence Type']},'qSortCriterias':[{'qSortByAscii':1}]}],[],{rows:$scope.pageSize})

but the values are displayed in some random order. Output I'm getting 

Other Absence

Special Absence

Not Applicable

Annual Absence

What I've observed is that values are sorted by qElemNumber.

Any help appreciated 

Marcin. 

1 Reply
salezian
Creator
Creator
Author

Ok, I've messed up with code. Code below works fine:

var name= {
"qDef": {
"qFieldDefs": ["Name"],
"qSortCriterias": [{
"qSortByAscii": 1
}],
"autoSort": false
}
}


$scope.table=app.createTable([name],[],{rows:$scope.pageSize})