Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sense extensions : How can I change qSelectionThreshold value ?

Hi everybody,

I'm new in the Qlik world, I want to work in Sense extensions and I've a question. It is probably a stupid question for you but I haven't again catch the overall vision of the development.

To learn quickly, I force myself to do specific use cases and detailled. In this view, my first target is to understand the selection and how to change its configuration.

This is my current code :

     define(["jquery", "text!./Log-CheckSelection.css", "qlik"], function ($, cssContent, qlik) {

         'use strict';

          $("<style>").html(cssContent).appendTo("head");

          return {

               initialProperties : {

                    version: 1.0,

                    qHyperCubeDef : {

                         qDimensions : [],

                         qMeasures : [],

                         qInitialDataFetch : [{

                              qWidth : 10,

                              qHeight : 50

                         }]

                    }

               },

               definition : {

                    type : "items",

                    component : "accordion",

                    items : {

                         dimensions : {

                              uses : "dimensions",

                              min : 0,

                              max : 0

                         },

                         measures : {

                              uses : "measures",

                              min : 0,

                              max : 0

                         }

                    }

               },

               snapshot : {

                    canTakeSnapshot : true

               },

               paint : function($element) {

                    var app = qlik.currApp(this);

                    app.getList("CurrentSelections", function(reply) {

                         var html = "<h1>Selection Logs</h1>";

                         var mySelectedFields = reply.qSelectionObject.qSelections;

                         var mySelectedFieldsLength = mySelectedFields.length;

                         console.log(mySelectedFields);

                        

                         for(var value in mySelectedFields){

                              html += "<h2>"+value.qField+"</h2>";

                              console.log(value);

                              for(var valueIn in value.qSelectedFieldSelectionInfo){

                                   html += "<p> - "+valueIn.qName+"<p>";

                              }

                         }

                        

                         console.log(html);

                         $element.html(html);

                     });

               }

          };

     });

Above 6 selected values, my display list stops writing data. In the Dev Tool, tab Console I see the object (in my logs) and in I see that the qSelectionThreshold = 6, the default value. I understand that I must to change this value before my paint function. My problem is : "Where and How ?"

I want the maximum of my selection on the object, is there max recommandation ?

Is there a "infinite" value to insert in the qSelectionThreshold?

Is it the good parameter to change ?

Instinctively, I would say it is to change in initialProperties but I don't know the hierarchy to apply.

Great thanks to your help.

5 Replies
Not applicable
Author

Seriously !

No one knows how to do or no one wants to help me ?

I cannot think that's not workable... any help by a qlik dev ?

I know it's a small question, but it's to completely understand and make customizable extensions.

I've now 123 views of this topic, so potentially 123 people who have the same question...

Thanks.

Anders-Nilsson
Employee
Employee

Hey Julie

I tried your code and it didn't work as I expected.

First you need to get your javascript for-loops right ... C# loops doesn't work.

if you try this script your extension should at least work satisfying.

define( [

    "jquery",

    "text!./Log-CheckSelections.css",

    "qlik"

], function (

  $,

  cssContent,

  qlik

) {

     'use strict';

     $("<style>").html(cssContent).appendTo("head");

     return {

          paint : function( $element ) {

               var app = qlik.currApp( this );

               app.getList( "CurrentSelections", function( reply ) {

                    var html = "<h1>Selection Logs</h1>";

                    var mySelectedFields = reply.qSelectionObject.qSelections;

                    mySelectedFields.forEach( function (value ) {

                         html += "<h2>"+value.qField+"</h2>";

                         value.qSelectedFieldSelectionInfo.forEach( function( valueIn ) {

                              html += "<p> - "+valueIn.qName+"<p>";

                         } );

                 } )

                 $element.html(html);

            });

       }

     };

});


About changing the qSelectionThreshold value you will need to change a user setting. Unfortunately we don't expose any user settings in QlikSense yet (on the roadmap). But there is a way to change it if you're running Desktop.


Close your desktop application and browse to your Sense Folder. Typically in "C:\Users\UserName\Documents\Qlik\Sense"

There you will hopefully find a settings.ini file. Open that in a text editor (notepad) and insert the following line:

MaxCurSelEntries=15

somewhere under the [Settings7] - section. If you add the line last in the file you have to make sure there is an empty newline last in the file under your entry.

Restart QlikSense Desktop. Now your qSelectionThreshold should be 15. Change it to what you want, but keep in mind that if you have a very high number you will send unnecessarily big amount of data to the javascript code in some situations and your application will not be responding very well.

raajeshn
Partner - Creator
Partner - Creator

Hi Anders,

We are working on creating an extension for creating On Demand App Generaton where we are reading the selected values (of a field) which is passed to the Where Clause of the query. We are hitting the same issue here if the number of items selected is more than 6. I see that your response is 6 months old - hence, just curious if there is any update after this? Appreciate your help.

Thanks & Regards,

Raajesh N

Not applicable
Author

Sorry I don't have an answer, I just posted here in hopes that someone would see this post and hopefully provide an answer. I get the limiting to 6 I do, but surely there is a way with Qlik Sense to get more than 6 selections or has everyone just accepted the limit of 6.

will_br
Contributor III
Contributor III

Hi @Anders-Nilsson  . Did qlik have the chance to work on this topic? Or changing the user setting is still the only way of fixing it?