Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
MatthiasD
Contributor
Contributor

Limit scatter plot data to top n of y-axis values

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!

Labels (3)
1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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

View solution in original post

3 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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

MatthiasD
Contributor
Contributor
Author

Hi Steve,

 

thanks a lot for the comprehensive explanation and the nice blog post! This helps my case indeed.

 

Best,

Matthias

 

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

No worries, glad it has helped. Thanks for marking the solution and helping others on the Community by doing so.

Steve