Alteryx Designer Desktop Discussions

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

Dynamic top N rows

Yuri24
8 - Asteroid

Hello,

 

I have a question on selecting top N rows for a data set. I understand I can use TOP N rows from Sample tile to select number of rows I want but what I am looking for is something dynamic. 

Here is the sample data set. Data has been grouped by the field Number and ranked accordingly. However I from each group of unique Number I need to select only half rows. If the number of rows is N and for a group of N is even I need to select First N/2 rows if N is odd then first N/2+1 rows. 

NameNumber Rank
John12345678901
Jane12345678902
John12345678903
Jane12345678904
John12345678905
Jane12345678906
Shawn23456789011
Shane23456789012
Shawn23456789013
Shane23456789014
Shawn23456789015
Shane23456789016
Shawn23456789017
Shane23456789018
Shawn23456789019

From the sample data set above I will need:

 

NameNumber Rank
John12345678901
Jane12345678902
John12345678903
Shawn23456789011
Shane23456789012
Shawn23456789013
Shane23456789014
Shawn23456789015

 Is this possible?

 

Thanks in advance.

2 REPLIES 2
binuacs
19 - Altair

@Yuri24 One way of doing this

image.png

Amol_Telore
11 - Bolide

Hey @Yuri24 

 

I tried Sample tool and I was able to get desired results. Please check below configuration for your reference.

Capture.PNG

Labels