← concat operator page · string/concat/sc_comp/prefix_and_null_component
pandas ✅ · DuckDB ✅
"Hello " || Me_1 inside calc, where Me_1 is null in one data point.
String concatenation: "Concatenates two strings." A new component "is added to the original Components of DS_1, by default as a Measure" (Typical behaviours).
Me_2 is Hello World and Hello VTL; 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.
DS_r := DS_1[calc Me_2 := "Hello " || Me_1];
| Id_1 | Me_1 |
|---|---|
| 1 | World |
| 2 | VTL |
| 3 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | World | Hello World |
| 2 | VTL | Hello VTL |
| 3 |
{
"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"}
]
}
]
}