← calc operator page · clause/calc/viral_attribute/constant_viral_attribute
pandas ✅ · DuckDB ✅
calc viral attribute At_1 := "EP": the calculation of Manual example 2 of the attribute form, with the role viral attribute.
Calculation of a Component: "The keyword viral allows controlling the virality of the calculated Attributes".
The input, plus the Viral Attribute At_1 = EP on every data point. calc combines no data points, so no propagation rule is involved: the attribute is only created.
#1257: as the comments on sdmx-twg/vtl#731 propose, a viral Attribute needs a propagation rule only where its values are combined, until the VTL Task Force discusses it.
DS_r := DS_1 [ calc viral attribute At_1 := "EP" ];
| Id_1 | Me_1 |
|---|---|
| 1 | 10 |
| 2 | 20 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | At_1 |
|---|---|---|
| 1 | 10 | EP |
| 2 | 20 | EP |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"},
{"name": "At_1", "type": "String", "role": "Viral Attribute"}
]
}
]
}