← random operator page · numeric/random/comp/seed_replaced_by_draws

Seed replaced by draws 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

random whose result component is the seed measure itself.

Manual:

Random: "The operator returns a random decimal number >= 0 and <1."

Expected:

Me_1 is replaced by the draws, as any operator on components replaces a measure of the same name; no seed column is left to compare, so the expected file has the structure only and the draws are checked as numbers in [0, 1) that are the same on every run.

script.vtl ⇩

DS_r := DS_1[calc Me_1 := random(Me_1, 5)];

input/DS_1.csv ⇩

Id_1Me_1
116.0
24.0
37.2

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
        {"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true}
      ]
    }
  ]
}

expected/DS_r.csv ⇩

Id_1Me_1

(no data points)

expected/DS_r.json ⇩

{
  "datasets": [
    {
      "name": "DS_r",
      "DataStructure": [
        {"name": "Id_1", "type": "Integer", "role": "Identifier"},
        {"name": "Me_1", "type": "Number", "role": "Measure"}
      ]
    }
  ]
}