← sub operator page · clause/sub/one_id/fixed_identifier_dropped
pandas ✅ · DuckDB ✅
sub Id_1 = 1, alone, on one of two identifiers.
Subspace: "It maintains the Data Points of VDS for which identifier = value (for all the specified identifier) and eliminates all the Data Points for which identifier <> value", then "It projects out (“drops”, in VTL terms) all the identifier (s)".
(1,A) = 10 and (1,B) = 20 are kept and (2,A) = 30 is eliminated; Id_1 is projected out, leaving Id_2 and Me_1. Manual example 3 adds two subspaces with +; this one shows sub alone.
DS_r := DS_1 [ sub Id_1 = 1 ];
| Id_1 | Id_2 | Me_1 |
|---|---|---|
| 1 | A | 10 |
| 1 | B | 20 |
| 2 | A | 30 |
{
"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}
]
}
]
}
| Id_2 | Me_1 |
|---|---|
| A | 10 |
| B | 20 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}