Random Sampling

Generate random samples from uploaded CSV or Excel files

The Random Sampling tool lets you upload a list of records (for example, a list of households or participants) and generate a randomly selected subset for field data collection or follow-up.

When to Use It

  • When you need to select a random sample from a list of units
  • When you want to create a shorter list for pilot testing
  • When you need a reproducible random subset for follow-up surveys

How to Access This Page

  1. Log in to the application
  2. From the sidebar, navigate to Data → Random Sampling
  3. Or, directly navigate to /data/sampling in your browser

Permissions or prerequisites

  • You must be logged in to access this page
  • You need the appropriate permissions (typically response:export or full access)

Page Layout

The page has two cards:

1. Upload File

  • Drag and drop area or click to browse
  • Supported formats: .csv, .xlsx, .xls (up to 50 MB)
  • Shows the selected file name and size once uploaded

2. Configure Sample

  • Sample Size: Enter the number of records to randomly select
  • Output Format: Choose CSV, Excel, or JSON
  • Generate Sample: Downloads the sampled file when ready

Step-by-Step: Generate a Random Sample

  1. Click the upload area or drag your CSV/Excel file into it
  2. Enter the Sample Size (number of rows to select)
  3. Select the Output Format (CSV, Excel, or JSON)
  4. Click Generate Sample
  5. The sampled file will download automatically when complete

Tips & Notes

  • The sampling uses a fixed random seed for reproducibility (as noted in the UI)
  • Make sure your file has column headers so the output remains readable
  • If you get an error, check that the file format and size are valid
  • Large files (up to 50 MB) are supported