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.
Name | Number | Rank |
John | 1234567890 | 1 |
Jane | 1234567890 | 2 |
John | 1234567890 | 3 |
Jane | 1234567890 | 4 |
John | 1234567890 | 5 |
Jane | 1234567890 | 6 |
Shawn | 2345678901 | 1 |
Shane | 2345678901 | 2 |
Shawn | 2345678901 | 3 |
Shane | 2345678901 | 4 |
Shawn | 2345678901 | 5 |
Shane | 2345678901 | 6 |
Shawn | 2345678901 | 7 |
Shane | 2345678901 | 8 |
Shawn | 2345678901 | 9 |
From the sample data set above I will need:
Name | Number | Rank |
John | 1234567890 | 1 |
Jane | 1234567890 | 2 |
John | 1234567890 | 3 |
Shawn | 2345678901 | 1 |
Shane | 2345678901 | 2 |
Shawn | 2345678901 | 3 |
Shane | 2345678901 | 4 |
Shawn | 2345678901 | 5 |
Is this possible?
Thanks in advance.
Solved! Go to Solution.
@Yuri24 One way of doing this
Hey @Yuri24
I tried Sample tool and I was able to get desired results. Please check below configuration for your reference.