← period_indicator operator page · time/period_indicator/comp/manual_ex_2
pandas ✅ · DuckDB ✅
period_indicator(Id_3) inside filter, compared with cast("A", duration): the annual data points are kept.
Period indicator, Example 2, output verbatim: "The period indicator is the part of the time_period value which denotes the duration of the time period (e.g. day, week, month...)."
2010 has the indicator A and 2013Q1 has Q, so the data point of 2010 is kept, with all its components.
DS_r := DS_1 [ filter period_indicator ( Id_3 ) = cast("A", duration) ];
| Id_1 | Id_2 | Id_3 | Me_1 |
|---|---|---|---|
| A | 1 | 2010 | 10 |
| A | 1 | 2013Q1 | 50 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_3", "type": "Time_Period", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Integer", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Id_3 | Me_1 |
|---|---|---|---|
| A | 1 | 2010 | 10 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier"},
{"name": "Id_2", "type": "Integer", "role": "Identifier"},
{"name": "Id_3", "type": "Time_Period", "role": "Identifier"},
{"name": "Me_1", "type": "Integer", "role": "Measure"}
]
}
]
}