← lower operator page · string/lower/comp/all_caps_and_mixed_case

All caps and mixed case 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

lower of a component inside calc, with an all-capitals value, a mixed-case one and a null.

Manual:

Character case conversion: "Converts the character case of a string in upper or lower case."

Expected:

the new measure Me_2 is hello for HELLO and hi there for Hi There; Me_1 is kept. A null operand gives a null result: "most of the scalar operations (arithmetic, logical, and others) return null when any of their arguments is null" (User Manual), as the manual's length and instr examples show.

script.vtl ⇩

DS_r := DS_1[calc Me_2 := lower(Me_1)];

input/DS_1.csv ⇩

Id_1Me_1
1HELLO
2Hi There
3

input/DS_1.json ⇩

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

expected/DS_r.csv ⇩

Id_1Me_1Me_2
1HELLOhello
2Hi Therehi there
3

expected/DS_r.json ⇩

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