← sub operator page · clause/sub/multi_id/manual_ex_2
pandas ✅ · DuckDB ✅
sub Id_1 = 1, Id_2 = "B", Id_3 = "YY": every identifier fixed.
Subspace, Example 2, output verbatim: "The resulting Data Set has the Identifier Components that are not specified as identifier (s) and has the same Measure and Attribute Components of the input Data Set."
The data point (1,B,YY) alone, with no identifiers: Me_1 = 9 and At_1 = F.
DS_r := DS_1 [ sub Id_1 = 1, Id_2 = "B", Id_3 = "YY" ];
| Id_1 | Id_2 | Id_3 | Me_1 | At_1 |
|---|---|---|---|---|
| 1 | A | XX | 20 | F |
| 1 | A | YY | 1 | F |
| 1 | B | XX | 4 | E |
| 1 | B | YY | 9 | F |
| 2 | A | XX | 7 | F |
| 2 | A | YY | 5 | E |
| 2 | B | XX | 12 | F |
| 2 | B | YY | 15 | F |
{
"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": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
{"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
]
}
]
}
| Me_1 | At_1 |
|---|---|
| 9 | F |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Me_1", "type": "Integer", "role": "Measure"},
{"name": "At_1", "type": "String", "role": "Attribute"}
]
}
]
}