Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More

Random Sampling by Group Allocation


I was using the Cust_wTransactions sample file in Alteryx to obtain a random number of samples from each group. The workflow below was able to provide me with a general ten samples for each group, however, I was stuck on trying to determine what tools I could use to change the allocation for each group based on its size in the overall sample. Thanks for your help! RandSamplingOnGroup.png



What is your ideal output?  You could use a sample tool and group by segment and have it return 1 in N rows where you can type in what N is (1 in 10 would be about 10% of the data per segment) , etc.


I am not sure if that was what you are aiming for?


My ideal output is to be able to obtain a certain % of each sample based on the customer segment. For example, I would like 20% of Home Office based on the overall population, not the Home Office population. I was able to move onto this step (workflow attached below), but this is taking a certain percentage of each sample by its specific consumer segment size, not the overall dataset. I appreciate your help! 


I also have come up with this, but it requires that you manually set the sample size for each group and does not automate the process for you.