← concat operator page · string/concat/comp_comp/null_right_operand
pandas ✅ · DuckDB ✅
Me_1 || Me_2 inside calc, where Me_2 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_3 is foobar and abcd; Me_1 and Me_2 are 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_3 := Me_1 || Me_2];
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| 1 | foo | bar |
| 2 | ab | cd |
| 3 | x |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "String", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 | Me_3 |
|---|---|---|---|
| 1 | foo | bar | foobar |
| 2 | ab | cd | abcd |
| 3 | x |
{
"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"},
{"name": "Me_3", "type": "String", "role": "Measure"}
]
}
]
}