In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Sample with filter

akasubi
8 - Asteroid

I would like to take samples of my data with a filter applied on the samples.

 

E.g.

 

Take 40% sample where column = A

Take 40% sample where column = B

Take 20% sample where column = C

 

Is this possible?

 

 

3 REPLIES 3
messi007
15 - Aurora
15 - Aurora

@akasubi,

 

I suggest you to use Filter and sample and union them after:

 

messi007_0-1613034080214.png

Attached the workflow,

 

Hope this helps,

Regards

akasubi
8 - Asteroid

Hi @messi007, thanks for your suggestion.

 

I do have a question though, doesn't the size of the sample change based on the number of values you get after your filtering? If value A has a lot more records in the data than value B, then taking 40% off of those will be different.

 

I'm looking to get a sample % (of each condition) of the total output.

 

Suppose my final output has 1000 records, 400 of those should equal condition A, 400 condition B and 200 condition C. Sorry should've been clearer.

messi007
15 - Aurora
15 - Aurora

@akasubi,

 

I have done a Batch Macro in order to batch in each condition

 

messi007_0-1613037308922.png

 

Attached a zipped workflow.

 

messi007_1-1613037344362.png

Hope this helps,

 

Regards,

Labels
Top Solution Authors