Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am encountering an issue with a dataset that is too large to display at once in a pivot table in Qlik Sense. To manage this, I want to implement a solution where if the user selects "ALL" for Column A, they are prevented from selecting "ALL" for Column B and vice versa in the filter pane. Below is an example of the logic I am using:
```
if(GetSelectedCount([Column A]) = count(Distinct All Column A]) and GetSelectedCount([Column B]) = count(Distinct All [Column B]),0,1)
```
This code is implemented in the Add-ons section under Data Handling to restrict the view of the pivot table for other users. However, the table is loading all records before applying the filter logic, which is leading to memory consumption errors, as shown in the attached screenshot.
Do you have any suggestions on how to trigger the code before the table attempts to load all selected columns from Column A and Column B?
Thank you for your assistance! 🙂
@nurnazifa
See the following alternative, insert a fixed limit value for displaying these fields
Example:
if(GetSelectedCount([Column A])>10 and GetSelectedCount([Column B])>10,0)
In my example, I put this value at 10 as a limit, which can be changed according to your needs
- Matheus
Thanks Matheus.
It seems to work when I use a fixed limit value, as the table validates by triggering the code before attempting to load all selected columns from Column A and Column B. However, I was wondering if you could kindly explain why a fixed limit value is working perfectly fine?
I would prefer the code to be more dynamic for easier use in the future. Is there a way to make the code more flexible?
I don't see any other alternative given the form you're looking for.
Regards, Matheus
Assuming a selection is mandatory (which seems to be implied as you are using GetSelectedCount) you can use GetAlternativeCount and GetExcludedCount to get the remaining list of values without the need for a complex Count(Distinct All). If not mandatory, you should perhaps be using GetPossibleCount instead of GetSelectedCount.