← nvl operator page · conditional/nvl/sc_sc/non_null_first_operand

Non null first operand 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

nvl ( SC_1, SC_2 ) with SC_1 = 5 and SC_2 = 0: a first operand that is not null.

Manual:

Nvl: "nvl ( 5, 0 ) returns 5".

Expected:

SC_r = 5, an Integer: op1 is not null, so it is the result.

script.vtl ⇩

SC_r := nvl ( SC_1, SC_2 );

input/scalars.csv ⇩

SC_1SC_2
50

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Integer"},
    {"name": "SC_2", "type": "Integer"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_r", "type": "Integer", "value": "5"}
  ]
}