← dayofyear operator page · time/dayofyear/comp/leap_and_common_years
pandas ✅ · DuckDB ✅
dayofyear(Me_1) inside calc, on March 1st of a common and of a leap year, and on the last day of a leap year.
Extract time period: "The operator dayofyear returns the ordinal day within the year (between 1 and 366)."
Me_2 is 60 (31 + 28 + 1, in 2019), 61 (31 + 29 + 1, in 2020) and 366, Integers.
DS_r := DS_1[calc Me_2 := dayofyear(Me_1)];
| Id_1 | Me_1 |
|---|---|
| G | 2019-03-01 |
| H | 2020-03-01 |
| T | 2020-12-31 |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "Date", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| G | 2019-03-01 | 60 |
| H | 2020-03-01 | 61 |
| T | 2020-12-31 | 366 |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "Date", "role": "Measure"},
{"name": "Me_2", "type": "Integer", "role": "Measure"}
]
}
]
}