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: 
GOKULAKANNAN
Creator II
Creator II

Limit the selections in filter (select 5 values)

Hi,

I have a field called number(having 50 rows), i have defined that as a filter in my sheet, I need to select upto 5 values for that field, not more that that.

Like always one selected value, how can i acheive always 5 selected value..is there any possibility in qliksense.

 

Thank you!

1 Solution

Accepted Solutions
Andrei_Cusnir
Specialist
Specialist

Hello,

 

I can see now where exactly you would like to use this feature. Unfortunately, restricting the "Generate new app" button for when you are creating an On-Demand App is not possible. This configuration needs to be applied directly on the field in your dataset as "Always one selected value" option, however this is only possible for 1 value and not 5. You should submit a feature request [1] and explain in detail as to why this feature will be helpful for On-Demand App Generation. Additionally, you can mentioned that the feature should allow you to specify the minimum number of selected values for that particular field, instead of having a couple of default options, besides the "1".

 

I hope that this information is helpful. 

 

---

[1] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂

View solution in original post

3 Replies
Andrei_Cusnir
Specialist
Specialist

Hello,

 

If my understanding is correct, you would like to find a way implement "Always one selected" feature but for 5 values instead of 1. I believe that natively it is not supported but you can submit a feature request [1] and describe how setting up a custom value for "Always # selected" feature can be beneficial. As you can see, in the official documentation "Always one selected value" [2], the only possible way, is to have 1 value selected.

 

There is a workaround which can bring you close enough to your use case scenario, but there could be other options/workarounds that can help as well. For example, if your plan is to restrict specific Charts from being displayed unless the user selects exactly 5 values from specific field, then one approach would be:

  1. Create the Chart that you want to restrict. In my example I will use Table chart
  2. Go to "Add-ons > Data handling" and under "Calculation condition" you can use the expression "=GetSelectedCount(FIELD) = 5"
  3. If you pass the FIELD inside the GetSelectedCount() function, then whenever you select a value from that FIELD the function will return the count of the selected values. So in this case the condition will only be true if exactly 5 values are selected.
  4. Then you can also write a descriptive error message under "Displayed message" such as "Please select exactly 5 options from field FIELD"

Here are the examples:

 

3 values selected:

 

6 values selected:

 

5 values selected:

 

As you can see, only if the exact amount of values that I want are selected, then the user can see the analysis. So in general this workaround doesn't do exactly what you are looking for, but it is close enough I believe.

 

In case you are planning to use this workaround for many Charts and you want it to be scalable, just in case in the future you want to change the requirement from 5 to 6 for example. Then instead of going to each visualization and changing it, you can use the expression in a public variable.

  1. Create an variable as:
  2.  
  3. Then in the Chart you should update the "Show condition" as "$(varCondition)"
  4. This means that if you want to change the condition, you have to just update the public variable and the condition will be applied to all the Charts, where the variable is used as the condition.

I hope that this information was helpful. In case I have misunderstood the use case scenario please elaborate further in detail as to what exactly you are trying to achieve.  

---

[1] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

[2] https://help.qlik.com/en-US/sense/August2021/Subsystems/Hub/Content/Sense_Hub/DataSource/select-sing...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂
GOKULAKANNAN
Creator II
Creator II
Author

Hi Andrei,

 

Thanks for the explanation,

I just need this field to be selected to create ODAG template, how can we restrict the Creation of ODAG , if only we select 5 values of a field, then only i should be able to create template app.

 

 

Andrei_Cusnir
Specialist
Specialist

Hello,

 

I can see now where exactly you would like to use this feature. Unfortunately, restricting the "Generate new app" button for when you are creating an On-Demand App is not possible. This configuration needs to be applied directly on the field in your dataset as "Always one selected value" option, however this is only possible for 1 value and not 5. You should submit a feature request [1] and explain in detail as to why this feature will be helpful for On-Demand App Generation. Additionally, you can mentioned that the feature should allow you to specify the minimum number of selected values for that particular field, instead of having a couple of default options, besides the "1".

 

I hope that this information is helpful. 

 

---

[1] https://community.qlik.com/t5/Knowledge-Base/How-To-Submit-Feature-Requests-For-Qlik-Products/ta-p/1...

Help users find answers! Don't forget to mark a solution that worked for you! 🙂