Extract the day of the month · dayofmonth
---
config:
flowchart:
useMaxWidth: false
---
flowchart TB
classDef ok fill:#d4edda,stroke:#28a745,color:#000
classDef partial fill:#fff3cd,stroke:#ffc107,color:#000
classDef refused fill:#d4edda,stroke:#28a745,stroke-width:3px,stroke-dasharray: 2 2,color:#000
classDef missing fill:#f8d7da,stroke:#dc3545,color:#000
classDef diverge fill:#cce5ff,stroke:#007bff,color:#000
classDef block fill:#2b3a4a,stroke:#2b3a4a,color:#fff,font-weight:bold
classDef ext fill:#fff,stroke:#666,color:#000,stroke-dasharray: 5 5
O["Extract the day of the month · dayofmonth<br/>🟢2"]:::ok
subgraph G_comp["Component"]
direction LR
v_comp["calc dayofmonth(comp)"]:::ok
end
subgraph G_sc["Scalar"]
direction LR
v_sc["dayofmonth(sc)"]:::ok
end
O --- G_comp
O --- G_sc
style G_comp fill:#f8f9fa,stroke:#495057,stroke-width:2px,stroke-dasharray: 8 5
style G_sc fill:#f8f9fa,stroke:#495057,stroke-width:2px,stroke-dasharray: 2 3
click v_comp href "#form-comp"
click v_sc href "#form-sc"
Types
Takes date, time_period · Gives integer
Comes from · date, time_period — 8 operators in 2 blocks 🟢8
General purpose operators (1) 🟢1
Comes from · operators that return any type (their input's) — 36 operators in 8 blocks 🟢36
General purpose operators (6) 🟢6
Join operators (4) 🟢4
Set operators (4) 🟢4
Hierarchical aggregation (1) 🟢1
Aggregate and Analytic operators (8) 🟢8
Data validation operators (1) 🟢1
Conditional operators (3) 🟢3
Goes to · integer — 44 operators in 8 blocks 🟢44
General purpose operators (1) 🟢1
String operators (2) 🟢2
Numeric operators (18) 🟢18
Time operators (6) 🟢6
Hierarchical aggregation (1) 🟢1
Aggregate and Analytic operators (10) 🟢10
Data validation operators (2) 🟢2
Definitions (VTL-DL) (4) 🟢4
Goes to · operators that take any scalar — 46 operators in 8 blocks 🟢46
General purpose operators (6) 🟢6
Join operators (4) 🟢4
Comparison operators (11) 🟢11
Set operators (4) 🟢4
Aggregate and Analytic operators (8) 🟢8
Data validation operators (1) 🟢1
Conditional operators (3) 🟢3
Forms
calc dayofmonth(comp) 🟢 · date, time_period → integer
Leap day and month end 🟢 pandas ✅ · DuckDB ✅
- Tests:
dayofmonth(Me_1)insidecalc, on a date in the middle of a month, the leap day of 2020 and the last day of a month.- Manual:
Extract time period: “The operator dayofmonth returns the ordinal day within the month (between 1 and 31).”
- Expected:
Me_2is 15, 29 and 31, Integers.
DS_r := DS_1[calc Me_2 := dayofmonth(Me_1)];
| Id_1 | Me_1 |
|---|---|
| G | 2019-01-15 |
| H | 2020-02-29 |
| T | 2020-12-31 |
| Id_1 | Me_1 | Me_2 |
|---|---|---|
| G | 2019-01-15 | 15 |
| H | 2020-02-29 | 29 |
| T | 2020-12-31 | 31 |
Files: script.vtl · input/DS_1.csv · input/DS_1.json · expected/DS_r.csv · expected/DS_r.json · example page ↗
dayofmonth(sc) 🟢 · date, time_period → integer
Mid month date 🟢 pandas ✅ · DuckDB ✅
- Tests:
dayofmonth(SC_1)on a scalar date,SC_1= 2020-12-14, the date of the page’s valid syntaxdayofyear (2020-12-14).- Manual:
Extract time period: “The operator dayofmonth returns the ordinal day within the month (between 1 and 31).”
- Expected:
DS_r = 14, an Integer: the 14th of December.
DS_r := dayofmonth(SC_1);
| SC_1 |
|---|
| 2020-12-14 |
Name |
Type |
Value |
|---|---|---|
|
Integer |
|
Files: script.vtl · input/scalars.csv · input/scalars.json · expected/scalars.json · example page ↗