Alteryx Designer Desktop Discussions

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

Select the first rows based on a criteria

insomned
8 - Asteroid

Hello, 

 

I would like to select the first N rows that contain a particular word (Boolean, in my case). For example:

 

Name     Age     Bool

 

Dora      13        True

Nelly      14        True

Kate       17        False

Michelle   19      True

 

I want to now have only the first 2 rows (ie the first rows, which contained "True"). 

 

Thank you!

1 REPLY 1
NicoleJohnson
ACE Emeritus
ACE Emeritus

If you use a Sample Tool in conjunction with a Filter, that should give you what you need! You can configure them in either direction (Sample then Filter, or Filter then Sample). 

 

Sample: Choose "First N" and then set N to 2, and Group By your particular word field (Boolean). This will keep the first 2 records for each word in the Boolean field... if you use this tool before Filter, you'll have 2 Trues and 2 Falses

Filter: Filter for only those records where "Boolean" is true

 

NicoleJohnson_0-1634680955920.png

 

Cheers,

NJ

Labels