community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Sampling Tool Query

Asteroid

I'm using the sampling tool to take the first 10 records after I've sorted them by value in descending order.  This works well enough but I notice that the 11th record is the same value as the 10th record and so I'd like to keep it.  Is there a way I can get the top 10 and any others that have the same value as the 10th?

 

Thanks in advance,

 

DHB.

Alteryx Partner

 

Here is an example that may help you.

 

This workflow evaluates the incidence of the 10 highest temperatures from a weather data set for California.

2018-02-06_00013.png

 

Note that this results in 17 records for the top 10 temperatures:

 

              results.png 

Asteroid

Thank  you for your solution.  I came up with something as well but it isn't as elegant as yours.  I kept the sampling tool and did this...

 

1.JPG 

I'm joining on the value

 

The first Summarize tool summarises the top 10 records that don't have an equivalent value in the other records,

The second Summarize tool summarises the top 10 records that do have an equivalent value in the other records, (Left records),

The third Summarize tool summarises the other records that have an equivalent value in the top 10 records (Right records).

 

Thanks for your help.

Labels