Create sample set
This script is used to randomly sample documents from a saved search to create a sample set. This is a case functionality script to be run at the case level. This script should not be run at the system level.
Special considerations
Consider the following when running this script:
- When the script runs, the selected Yes/No field is set to NULL if that field was populated with a value at the time of running.
- The universe size is the number of documents in the saved search selected in the Sample Universe input.
- If a value is entered in the Sample Size Percent input, a random selection of that percentage of documents from the Sample Universe are designated as sample set documents. Documents are designated as sample set documents with Yes in the new Yes/No choice field that was selected in the Sample Indicator input.
- For example, if you have a sample universe of 1000 documents and you enter a Sample Size Percent of 30 (or 30%), 300 documents in the Sample Universe is designated as Yes in the Yes/No choice field.
- Sample Set = Sample Universe * Sample Size Percent (in decimal form)
- Sample Set = 1000 * .3 = 300 documents
- If you enter a value in the Sample Size input, a random selection of that number of documents from the Sample Universe are designated as sample set documents. Documents are designated as sample set documents with Yes in the new Yes/No field that was selected in the Sample Indicator input.
For example, if you have a sample universe of 1000 documents, and you enter 250 as the Sample Size, 250 documents in the Sample Universe are designated as Yes in the Yes/No choice field.
Inputs
Before running this script, you must create a new Yes/No field to select as the Sample Indicator when running the script. Use this field only to designate randomly selected documents to be included in the sample set.
Complete the following inputs:
- Sample Universe - select a Saved Search from the drop-down list.
- Sample Indicator - select the newly created Yes/No field.
- Sample Size Percent - enter a value for the Sample Size Percent if you wish to calculate the sample size as a percentage of the entire universe. The percentage should be entered as a whole number of 2 digits or fewer. For example, ‘10’ represents 10%. You can enter a value for either the Sample Size Percent or the Sample Size field but not both. If you attempt to run the script with values for both a warning will appear.
- Sample Size -enter a value for the Sample Size input if you wish to calculate the sample size as a number of documents in the entire universe. The sample size should be entered as a whole number smaller than the size of the entire universe. You can enter a value for either the Sample Size Percent or the Sample Size field but not both. If you attempt to run the script with values for both a warning will appear.
Results
The output of the script displays the number of documents in the Sample Universe as well as the number of documents designated as Yes in the Sample Set.