Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Unique Random Sample Selection Based on Criteria

jconnolly028
5 - Atom

I am am currently trying to pick samples from a very large population, which normally takes hours, and I am trying to see if its possible to automate this with alteryx, given that this is a task that I perform frequently. I have attached a sample excel file that includes Fund Names, Asset ID's, and Asset Descriptions, and I need to pick samples based on the following criteria:

 

Criteria 1: This determines how many samples I need based on the total count of the securities within each fund. For example if a fund has more than 200 securities then I would need 16 samples, between 100 and 200 securities would be 10 samples, etc (This is shown in the attached workflow)

 

Criteria 2: The samples that are selected have to be unique across all the funds. For example, if I picked Asset ID "12345" from Fund C021 then this security could not be selected for any of the other funds, it would be removed from the population essentially. 

 

I think I need a batch macro to do this, but I am still pretty new to Alteryx and am wondering if someone can lead me in the right direction. Thanks for any help you can provide.

 

5 REPLIES 5
TomHH
Alteryx Alumni (Retired)

Hi @jconnolly028 , correct you can develop a batch macro to sample the fund names using the counts as your control parameter.

 

I've attached a workflow that should help you get unique assets across your samples by filtering out the samples from the population and re-sampling based on any duplicates. Hopefully this is what you're after.

 

Cheers.

 

TomHH_0-1675642242178.png

 

 

TomHH
Alteryx Alumni (Retired)

@jconnolly028 just checking whether this was useful or not? If so great if you can accept it as the solution for others to find.

 

Cheers

jconnolly028
5 - Atom

It took me a while to get back to this. So sorry about that. Thank you so much for providing this workflow to me. This is exactly what I was looking for. I really appreciate the help on this!

sachinsg
7 - Meteor

Hi@TomHH I am trying to leverage this workflow on one of my task and noted that I am unable to open the 2 macros. It says this workflow was built in the latest version. I am currently using 2020.4.5 version. Is their a way I can access full workflow with both the macros?.

 

Thank you!

sachinsg
7 - Meteor

@TomHH  @jconnolly028 can any of you please share the workflow with 2020 version or help me how to use this workflow?

Labels
Top Solution Authors