← sqrt operator page · numeric/sqrt/comp/manual_ex_2
pandas ✅ · DuckDB ✅
sqrt on a component inside calc, where the result replaces the measure Me_1.
Square root, Example 2, output verbatim: "The operator sqrt calculates the square root of a number."
Me_1 = sqrt(Me_1) is 4.0, 9.0 and 8.0; Me_2 is unchanged.
DS_r := DS_1 [ calc Me_1 := sqrt ( Me_1 ) ];
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 10 | A | 16 | 1.5625 |
| 10 | B | 81 | 11.2225 |
| 11 | A | 64 | 52.5625 |
{
"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": "Integer", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 10 | A | 4.0 | 1.5625 |
| 10 | B | 9.0 | 11.2225 |
| 11 | A | 8.0 | 52.5625 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Number", "role": "Measure"},
{"name": "Me_2", "type": "Number", "role": "Measure"}
]
}
]
}