Hi Guys -
I have a large population of data (around 400K lines). The population is broken down into certain categories (for e.g. Category A, Category B etc.) and i want to select 1 sample from each category.
Can someone advise how i can do this in alteryx?
Thanks
Solved! Go to Solution.
Hi @AlterixNoob
This can be accomplished using the Sample Tool. You can select a group by option that will allow you to select a sampling for each group based on how you configure the tool.
Here is more information on the sample tool: https://help.alteryx.com/current/designer/sample-tool
If this solves your issue please mark the answer as correct, if not let me know!
Thanks!
Phil
How is your data coming in?
What do you have so far?
Without knowing what you have so far, I will wing it. If it is one connection, I would use a filter to filter out the category and then use the sample tool to pass through only 1 row.
Thanks, Yes it's just one connection. I could do a filter but that would mean having 15-20 filters as i have 15-20 categories so looking for a better solution
Can the sample tool select a random sample? I don't want it to select the first one from each category. I don't want to define which record to pick, i just want it to pick one record at random from each of the categories
Hello @AlterixNoob ,
how about this solution:
This macro takes all the categories and depending on your selection takes the amount of random lines that you select on the macro.
If you need anything else let me know!
Regards
Hi @AlterixNoob
Try this method:
You create a random field, sort by company and newly created field, and then use the Sample Tool to select the first record of each group.
Thanks!
Phil