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.

GROUPED RANDOM SAMPLING

Gratus_tz
8 - Asteroid

Hi Everyone,

I have an Inquiry Regarding the Samples where I want to be able to pick Samples lets say in a GL which has a column of Accounting Codes but I want to pick my samples Randomly from each Account Code because if I set a normal Random Sample Function there some Accounts code are not Picked so what can I do.

Please Help! Thank you

 

2 REPLIES 2
Mathias_Nielsen
9 - Comet

Hi,

 

IDK if there is a simpler way, but you could make a batch macro choose the account code as the group by and control parameter field. Put your sample tool inside the macro and then the macro will do a sample for each of your account codes :)

ntakeda
12 - Quasar

Hi @Gratus_tz 

You can implement this by doing the following:

  1. Use the random function in the Formula tool.
  2. Sample using the Sampling tool.

2025-02-13_17h43_28.png

Each account code output 2records (or 1record if there is only 1 record).

I have attached the workflow. Please check it.

Labels
Top Solution Authors