← greater operator page · comparison/greater/comp_sc/manual_ex_2
pandas ✅ · DuckDB ✅
Me_1 > 20 inside calc, where the new measure Me_2 takes the result.
Greater than, Example 2, output verbatim: "The operator > returns true if left is greater than right, false otherwise."
Me_2 is true for F, false for R and null for G, whose Me_1 is null; Me_1 is kept.
DS_r := DS_1 [ calc Me_2 := Me_1 > 20 ];
| Id_1 | Id_2 | Id_3 | Id_4 | Id_5 | Me_1 |
|---|---|---|---|---|---|
| 2 | G | 2011 | Total | Percentage | |
| 2 | R | 2011 | Total | Percentage | 12.2 |
| 2 | F | 2011 | Total | Percentage | 29.5 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Id_4", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_5", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Number", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Id_4 | Id_5 | Me_1 | Me_2 |
|---|---|---|---|---|---|---|
| 2 | G | 2011 | Total | Percentage | ||
| 2 | R | 2011 | Total | Percentage | 12.2 | false |
| 2 | F | 2011 | Total | Percentage | 29.5 | true |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Id_3", "type": "Time_Period", "role": "Identifier"},
{"name": "Id_4", "type": "String", "role": "Identifier"},
{"name": "Id_5", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Number", "role": "Measure"},
{"name": "Me_2", "type": "Boolean", "role": "Measure"}
]
}
]
}