Alteryx Designer Desktop Discussions

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

Sampling Question

agimpel
7 - Meteor

I am trying to sample a population with specific parameters and would love some assistance. I have a population of "references" that have various risk ratings of Low, Medium and High. Each reference is associated with a business process as well. I want to create a sampling workflow so I can sample 1/3 of each of the business process references. How would i do this? example table below 

ReferenceRisk RatingBusiness Process
1214589LowAccounts Payable
1214591LowBank Reconciliations
1214741LowBank Reconciliations
1214742MediumCash
1214745MediumPension
1215115High Pension
1215110HighAccounts Payable
1215389HighAccounts Payable
6 REPLIES 6
Chaoued
7 - Meteor

can you explain what's the expected outcome?

agimpel
7 - Meteor

I want to sample 1/3 of the "references" from each business process so for example 1/3 of the accounts payable references etc. 

Chaoued
7 - Meteor

that's the result you want ?

 

ReferenceRisk RatingBusiness Process
1214589LowAccounts Payable
1214591LowBank Reconciliations
1214742MediumCash
1214745MediumPension
OTrieger
13 - Pulsar

@agimpel 

One way to do it is using filter to get the different rick rate, then connect it to sample tool and set it to 30%, then union the data back.

OTrieger
13 - Pulsar

You can do it also with a batch macro that the Control Parameter is the Risk Rating

Pilsner
11 - Bolide

Hello @agimpel,

One way to do this is to use the sample tool to select "1 of every N rows". By setting N = 3 and selecting a grouping mechanism of Business Process, I believe you will get the result you are after.

Screenshot 2025-03-12 172944.png


I am unsure weather you need the answer to be random or not, but to enforce a random selection, you can assign a random value to each record, then sort ascending. That way, all the order will be random each time, therefore, the values sampled will also be random. 

Screenshot 2025-03-12 172854.png


I have attached the workflow below in case you will find it helpful. Please let me know how you get on.

Regards - Pilsner

Labels
Top Solution Authors