Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

vegard_bakke
Contributor

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?

Tags (2)
1 Reply
vegard_bakke
Contributor

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

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?

Community Browser