← rtrim operator page · string/rtrim/comp/manual_ex_2
pandas ✅ · DuckDB ✅
rtrim of a component inside calc, on values that end with a space; the input quotes them, so the space is data.
Whitespace removal, Example 2, output verbatim: "Removes trailing or/and leading whitespace from a string."
the new measure Me_2 is hello and hi, without the trailing space; Me_1 keeps "hello " and "hi ".
DS_r := DS_1[ calc Me_2:= rtrim(Me_1)];
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 1 | A | hello |
| 2 | B | hi |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 1 | A | hello | hello |
| 2 | B | hi | hi |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "String", "role": "Measure"},
{"name": "Me_2", "type": "String", "role": "Measure"}
]
}
]
}