Hi,
I currently have a sampling tool which is set up as follows:
I'm trying to get two of each name appear, with random Record IDs being selected rather than the first two rows how would I do this?
The output I currently get is correct in terms of structure but some record IDs appear 80-something times (due to picking the first two rows):
The distribution of the questions should look like this (every question should be counted twice - unless there are less than 2 instances of it being answered):
Is there a better way to do this?
Solved! Go to Solution.
Hey @srea541 if you want to pull out a random 2 records for each Name then you could do something like this, whereby the batch macro pulls in one block of Names at a time, extracts a random 2 records from this set and then outputs this back into the main workflow. A quick example...
Here I have 1-100 for every letter of the alphabet:
Inside the macro:
Output:
Hope this helps but please let us know if you were looking for something else! :)
Hi @srea541
It can be achieved in a simple way.
Please find the solution below.
Kindly accept this solution if it provided a solution to your question.
Many thanks
Shanker V
@ShankerV as noted in the help documentation, using the 1 in N option won't consistently bring back the same amount (2) of records for each [Name]. See here - providing a 1 in 50 chance brings back 1 of some records, 0 of some and lots of others.
Hi @DataNath
I tried to resolve only part of problem, where
I'm trying to get two of each name appear, with random Record IDs being selected rather than the first two rows how would I do this?
To overcome this problem, we can use the method which I have mentioned where it will fetch random Record IDs as per the requirement.
To overcome the other points, I was assuming it can be overcome with Summarize tool and Filter according to the requirement.
The distribution of the questions should look like this (every question should be counted twice - unless there are less than 2 instances of it being answered):
Please let me know if otherwise as I might have not understood the second instance incorrecty.
Many thanks
Shanker V
Hey @DataNath Thank you for sharing this! Would you be able to save it in a way that I could open it on Alteryx 2020.4 please?
Many thanks!
No problem @srea541, please find them attached.
As a note, you can change the version of Alteryx assets by navigating to them and right click > open them within a text editor. You just need to find the version (which is in the top few lines) and change it there:
Would recommend creating a copy if you do this, as this can corrupt your files if you accidentally delete/add other parts.
@DataNath Thank you so much for sharing this - works perfectly!! :)