Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Random sampling by groups

tww
8 - Asteroid

Hi all,

 

I am looking for a way to get random samples based on the grouping.

See example below:

1) Randomly select 2 samples from the ones start with "A" under Group

2) Randomly select 3 samples from the ones start with "B" or "C" under Group

If the population is less than the sample size, then the whole population would be selected as in "B" group.

 

 

Data:

 

GroupText1Text2
A101A1A1
B101B1B1
A102A1A2
C103C1C3
C102C1C2
C101C1C1
A204A2A4
A102A1A2
B301B3B1
   

 

Desired outcome:

 

 GroupText1
Sample AA101A1
 A102A1
Sample CC103C1
 C102C1
 C101C1
Sample BB101B1
 B301B3

 

Thank you in advance for your help

0 REPLIES 0
Labels
Top Solution Authors