Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
vegard_bakke
Partner - Creator III
Partner - Creator III

Can't get sorting a qListObject by expression to ignore 'select state'

I've created a qListObject that I'd like to be sorted by an expression (descending).

The sorting works, initially. But as soon as I make a selection, the qSortByState kicks inn, and the selected value ends up first in the list.


I have tried turning off the qSortByState in a number of different ways. Here is my current code:


app.createList({

    "qFrequencyMode": "N",

    "qDef": {

            "qFieldDefs": [

                    "RegionName"

            ],

            "qSortCriterias": [

                 {

                    "qSortByFrequency": 0,

                    "qSortByNumeric": 0,

                    "qSortByAscii": 0,

                    "qSortByLoadOrder": 0,

                    "qSortByExpression": -1,

                    "qExpression": {

                        "qv": "=RegionNo"

                    },

                    "qSortByState": 0

                }

            ],

            "qAutoSortByState": {

              "qDisplayNumberOfRows": -1

            }

    },

    "qExpressions": [],

    "qInitialDataFetch": [

            {

                    "qHeight": 200,

                    "qWidth": 3

            }

    ],

    "qLibraryId": null

}, onDataRegion);

Can anyone spot a problem?

1 Reply
vegard_bakke
Partner - Creator III
Partner - Creator III
Author

A workaround might be to create a hypercube with qShowAll instead of creating a list, like Erik Wetterberg suggest here: Re: Is it possible to get expressions in a qListObject in a mashup?