Alteryx Designer Desktop Discussions

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

Adding Macros to my Sample Selection Workflow.

STerrace001
5 - Atom

Hey Everyone!

 

I've created a workflow that is able to take a file from one folder, select N amount of samples at random, and output the results to a different folder.

 

However, I want to make this tool a bit more powerful in two ways:

1. Having the workflow run for every file within a folder and outputting a new file for each file inputted.

2. Having the number of samples being selected be based on the population [P(Population) = 1, N(Samples)=1| P=4, N=2| P=12, N=5|P=52, N=15|P=250, N=40|P=250+, N=60]

 

I understand that this can be done with macros but try as I might I have been unable to make them work (I'm still a bit of a noob). Is anyone able to help me out? I've attached my current workflow for reference.

 

Thank you!

4 REPLIES 4
IraWatt
17 - Castor
17 - Castor

Hey @STerrace001,

Here's an example of how I would do this:

IraWatt_0-1653949137387.png

IraWatt_1-1653949157680.png

Essentially the the analytical app lets you pick two directories, one output one input. It also lets you select the number of rows from the sample tool. This information is the passed to a macro to output each file.

A lot to unpack here any questions or issues please ask :)
HTH!
Ira

Qiu
21 - Polaris
21 - Polaris

@STerrace001 

If you could provide sample insenstive data, I am sure the people here can look into it.😀

STerrace001
5 - Atom

@Irawatt Wow! Thanks for the help here this seems like the best solution. Unfortunately my organization seems to be stuck on an older version so I can't open your workflow but I'm hopeful that I can reverse engineer it from your explanation!

IraWatt
17 - Castor
17 - Castor

Hey @STerrace001,

Let me know if you have any issues. Also you can change the version of workflows by right clicking them and opening with notepad:

IraWatt_0-1654027438581.png

Just change the underlined details

 

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels