Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Set Analysis to filter for TOPx values

Hi,

I'm trying to create a pie chart which only contains the top 5 countries by sales.

A similar problem was discussed here: Selecting 200 entries from a bar chart to make a filter

@jpe uploaded an example file in that very thread: http://community.qlik.com/servlet/JiveServlet/download/659913-138096/Lunch%20and%20Learn.qvf

However, when I ran the example, the bottom pie chart is not displayed.

The message reads "Cannot display graph because it contains only negative or NULL values".

I tried on a different platform with English UI, same error.

Using QliKSense 1.1.

Thanks for your help!

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

If your 3rd measure was something like ' Count(CustomerID),

then you change your dimension to a calculated expression

In the following example, my dimension for the scatter is country.  If i change the dimension expression from Country to the following:

if(  aggr(rank( total Count(CustomerID)),Country) <=5 , Country)

...and then uncheck 'show nulls' , it will only show the 5 countries with the most customers

See below for the scatter chart showing the 5 countries with most customers (bubble size) and the full list on the left.

Capture.PNG

View solution in original post

7 Replies
JonnyPoole
Employee
Employee

There is actually an easier way in 1.1

See below screenshot showing 'Top x' properties on right side.

Capture.PNG

Not applicable
Author

Hi Jonathan,

thanks for your quick reply!

Unfortunately, I need the same for a scatter plot where the "Top" option is not available.

Any ideas?

JonnyPoole
Employee
Employee

hmm.. there is that option on a scatter plot. Its done on the dimension and pertains to the 1st measure.

Would that work ?

Untitled.png

Not applicable
Author

worked, thank you!

Not applicable
Author

Hi Jonathan,

just realised it only works for the first of the three dimensions. A filter for the top 1000 entries for, let's say' the third (bubble size) dimension is not possible.

Could you think of a workaround?

JonnyPoole
Employee
Employee

If your 3rd measure was something like ' Count(CustomerID),

then you change your dimension to a calculated expression

In the following example, my dimension for the scatter is country.  If i change the dimension expression from Country to the following:

if(  aggr(rank( total Count(CustomerID)),Country) <=5 , Country)

...and then uncheck 'show nulls' , it will only show the 5 countries with the most customers

See below for the scatter chart showing the 5 countries with most customers (bubble size) and the full list on the left.

Capture.PNG

Not applicable
Author

that's the one! Thank you very much!

Didn't think of manipulating the dimension rather than the measures. Now it seems rather obvious