← membership operator page · general/membership/on_aggregate/manual_ex_7
pandas ✅ · DuckDB ✅
max(DS_1)#Me_1: membership on the result of an aggregate invocation, which has no identifiers, gives a scalar.
Membership, Example 7, output verbatim: "If ds has no Identifier Components (for example is a result of an aggregate invocation), [...] the operator returns a scalar value equal to the value of comp in ds".
max(DS_1) has one data point, Me_1 = 3 and Me_2 = 12, so SC_r = 3, an Integer.
SC_r := max(DS_1)#Me_1;
| Id_1 | Id_2 | Me_1 | Me_2 | At_1 |
|---|---|---|---|---|
| 1 | A | 1 | 5 | |
| 1 | B | 2 | 10 | P |
| 2 | A | 3 | 12 |
{
"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": "Integer", "role": "Measure", "nullable": true},
{"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
]
}
]
}
{
"scalars": [
{"name": "SC_r", "type": "Integer", "value": "3"}
]
}