How to select a conditional sample?
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
johnnyacm
7 - Meteor
‎04-22-2024
02:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello community
I have the following question, I must select a sample from my database (input) with a quantity according to the condition of lines that the data contains (see image), I would like to know how to do it since with the sampling tools I have not seen solution
TKS
Labels:
- Labels:
- Custom Tools
- Expression
- Transformation
- Workflow
2 REPLIES 2
SPetrie
13 - Pulsar
‎04-22-2024
03:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
There may be a macro or better solution, but a quick way is to use random numbers to create your own sampler.
I used the record count to get the total number of lines. I created a random number for each line and used a formula to assign the size of the sample I want based on the record count. Then I sorted by the random number and assigned a new record id after the sort. A filter tool removes any id that is greater than the number of records I want.
I used the alphabet as the example input in the workflow.
21 - Polaris
‎04-22-2024
03:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
