We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Sample Tool

ktberger_2020
7 - Meteor

I have rows of inventory data sorted by NBV. I would like to return 50 total rows of data by pulling 20 rows where the NBV is >=$500 and 30 rows where the NBV is <$500; however, I have some instances where I don't have a total of 20 rows >=$500. How would I be able to fill in the missing rows of >=$500 with extra <$500 rows so that I will always return the desired 50 total rows?

2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hey @ktberger_2020 ,

 

Here is an example for you.

1. You order your dataset in a descending order for NBV

2. Separate the first 20 rows no matter what

3. Join tool to remove those 20 from your dataset

4. Filter rows <500

5. Sample the first 30

6. Done!

 

fmvizcaino_0-1648072383326.png

 

Best,

Fernando Vizcaino

 

ktberger_2020
7 - Meteor

This works for me. Thanks.

 

Labels
Top Solution Authors