← membership operator page · general/membership/attribute/dataset_without_identifiers

Dataset without identifiers 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

The scalar rule for an attribute, the case that Manual example 8 meant: on a dataset with no identifiers, DS_1#At_1 gives the value of At_1.

Manual:

Membership: "If ds has no Identifier Components (for example is a result of an aggregate invocation), comp must be a Data Set Component of the Data Set ds (a Measure or an Attribute). In this case the operator returns a scalar value equal to the value of comp in ds".

Expected:

SC_r = "P", a String. DS_1 is given as it is, without identifiers, because an aggregation would drop the non-viral At_1.

script.vtl ⇩

SC_r := DS_1#At_1;

input/DS_1.csv ⇩

Me_1At_1
5P

input/DS_1.json ⇩

{
  "datasets": [
    {
      "name": "DS_1",
      "DataStructure": [
        {"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true},
        {"name": "At_1", "type": "String", "role": "Attribute", "nullable": true}
      ]
    }
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_r", "type": "String", "value": "P"}
  ]
}