Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to create a scatter plot with alternative dimensions and for each of those, I want to limit to 100 points each.
Now I do get how this can simply be done via Limitation > fixed number, which however is always calculated based on the x-axis.
How could I limit to the top 100 based of the y-axis, or any other measure/expression for that matter?
Many thanks in advance!
Hi @MatthiasD
The place to deal with this is not in the measure code, but actually in the dimension.
Take off the limit on the dimensions, so that is No Limitation, and change the name of the dimension to be:
=aggr(if(rank(TOTAL sum(MyYAxisValue)) <= 100, [My Dimension], null()), [My Dimension])
This will only return a dimension value if it is in the top 20 of dimensions based on the expression, otherwise it is null. You can then turn off the null value by unticking Include Null Values. Alternatively, replace null() in the expression with 'Other' and you can have an accumulation of all other dimension values in your chart.
This may not play nicely with alternate dimensions, but if you plumb this code into each of the dimensions then it may work.
Alternatively, this blog post links to an app which has a different way of allowing the user to pick dimensions and measures, you may find this helps in achieving what you want.
https://www.quickintelligence.co.uk/instant-qlik-sense-application/
Hope that helps,
Steve
Hi @MatthiasD
The place to deal with this is not in the measure code, but actually in the dimension.
Take off the limit on the dimensions, so that is No Limitation, and change the name of the dimension to be:
=aggr(if(rank(TOTAL sum(MyYAxisValue)) <= 100, [My Dimension], null()), [My Dimension])
This will only return a dimension value if it is in the top 20 of dimensions based on the expression, otherwise it is null. You can then turn off the null value by unticking Include Null Values. Alternatively, replace null() in the expression with 'Other' and you can have an accumulation of all other dimension values in your chart.
This may not play nicely with alternate dimensions, but if you plumb this code into each of the dimensions then it may work.
Alternatively, this blog post links to an app which has a different way of allowing the user to pick dimensions and measures, you may find this helps in achieving what you want.
https://www.quickintelligence.co.uk/instant-qlik-sense-application/
Hope that helps,
Steve
Hi Steve,
thanks a lot for the comprehensive explanation and the nice blog post! This helps my case indeed.
Best,
Matthias
No worries, glad it has helped. Thanks for marking the solution and helping others on the Community by doing so.
Steve