Join the Inspire AMA with Joshua Burkhow, March 31-April 4. Ask, share, and connect with the Alteryx community!

Alteryx Designer Desktop Discussions

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

How to select a conditional sample?

johnnyacm
7 - Meteor
Hello community
 
I have the following question, I must select a sample from my database (input) with a quantity according to the condition of lines that the data contains (see image), I would like to know how to do it since with the sampling tools I have not seen solution
 
sampling.png
TKS 
2 REPLIES 2
SPetrie
13 - Pulsar

There may be a macro or better solution, but a quick way is to use random numbers to create your own sampler.

I used the record count to get the total number of lines. I created a random number for each line and used a formula to assign the size of the sample I want based on the record count. Then I sorted by the random number and assigned a new record id after the sort. A filter tool removes any id that is greater than the number of records I want.

I used the alphabet as the example input in the workflow.

rand.PNG

Labels
Top Solution Authors