← period_indicator operator page · time/period_indicator/ds/manual_ex_1
pandas ✅ · DuckDB ✅
period_indicator(DS_1): the period indicator of the time_period identifier Id_3 of each data point, in the one measure duration_var.
Period indicator, Example 1, output verbatim: "The operator returns a Data Set with the same Identifiers of op and one Measure of type duration named duration_var."
A for the year 2010 and Q for 2013Q1, which the manual's output writes 2013-Q1, the same period; Me_1 is dropped.
DS_r := period_indicator ( DS_1 );
| 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 | duration_var |
|---|---|---|---|
| A | 1 | 2010 | A |
| A | 1 | 2013-Q1 | Q |
{
"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": "duration_var", "type": "Duration", "role": "Measure"}
]
}
]
}