← equal operator page · comparison/equal/comp_sc/manual_ex_2
pandas ✅ · DuckDB ✅
Me_1 = 0.08 inside calc, where the new measure Me_2 takes the result.
Equal to, Example 2, output verbatim: "The operator returns true if the left is equal to right, false otherwise."
Me_2 is true for F and W, false for G, S and M, and null for B, whose Me_1 is null; Me_1 is kept.
DS_r := DS_1 [ calc Me_2 := Me_1 = 0.08 ];
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 |
|---|---|---|---|---|
| 2012 | B | Total | Total | |
| 2012 | G | Total | Total | 0.286 |
| 2012 | S | Total | Total | 0.064 |
| 2012 | M | Total | Total | 0.043 |
| 2012 | F | Total | Total | 0.08 |
| 2012 | W | Total | Total | 0.08 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_4", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Id_4 | Me_1 | Me_2 |
|---|---|---|---|---|---|
| 2012 | B | Total | Total | ||
| 2012 | G | Total | Total | 0.286 | false |
| 2012 | S | Total | Total | 0.064 | false |
| 2012 | M | Total | Total | 0.043 | false |
| 2012 | F | Total | Total | 0.08 | true |
| 2012 | W | Total | Total | 0.08 | true |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Time_Period", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Id_3", "type": "String", "role": "Identifier"},
{"name": "Id_4", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Number", "role": "Measure"},
{"name": "Me_2", "type": "Boolean", "role": "Measure"}
]
}
]
}