Select Randomly one person from an address
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Everyone,
I have few name and address information in my file and multiple persons are present in one address. Will Sample tool help me to select randomly any one person living in a particular address?
Any guidance will be highly appreciated.
Thanks in advance,
Solved! Go to Solution.
- Labels:
- Best Practices
- Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Bitopi
I don't think that a simple sample tool can do it because it doesn't have the option to randomly select a single resident per address.
You can use a formula tool to assign a random number between 0-1 to each resident and then keep only the resident with the highest number assigned per address. This is dynamic, so every time the workflow runs, new number will be assigned to the residents of each address
Hope that helps,
Angelos
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @Bitopi
You can easily do that with the help of Random % sample tool. This tool picks up records randomly and displays the output. each time you run the workflow, the result gets changed.
Check my solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
But I think the requirement here is to randomly get a single person from each group and the Random % Sample tool doesn't have an option to group by.
For example if your input is something like this
you want to get one person from address A and one from address B, and I don't see how the Random % sample tool can do that. Correct me if I'm wrong @Kurohits @Qiu 🤔
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AngelosPachiswouldn't batch macro with a random % sample work? If we think of it as 1000 corporate locations versus 1,000,000 residential houses that makes sense - no? then again - poster says "living." and I can't see the macro/random sample approach making sense for that situation.
unique set on a address will obviously give the first record in each set. Not quite random though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@apathetichell I can see how a batch macro would work, but isn't it an overkill? Besides, It would probably act as a bottleneck slowing the runtime considerably for large volume of records (10000000 rows for example) as each group should be processed separately.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AngelosPachisYes - unless this is a situation where the amount of people living at an address (apartment buildings/dorms/senior centers) make it useful vis-a-vis the number of locations.
For a standard solution - I'd suspect a tile, randomized number via formula tool, summarize select the highest (or lowest) random number grouped by location would make the most sense.
But I'm also not sure what I even read what the poster is looking for correctly - and this might not be a case of randomization but rather a case of trying to split a cell with a joint address/name field correctly. If that is the case - data samples would obviously be helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@AngelosPachis @apathetichell @Kurohits
Thank you for calling, I guess.
I tried both approach, which both good to me.
To be perfectly honest, the macro is a bit overkill though. 😁
We could judge better if we can come to know the real business scenario here.
