The Get Major Minor Ticker (ast_fn_GetMajorMinorTicker) Data Block is designed to dynamically generate a sequence of date “ticks” between a given “begin_date” and an “as_of_date”. Depending on inputs, it can emit monthly, quarterly, annual, or auto-calculated periods based on dataset “size” and the elapsed time window. The output is a simple data table with a single Period column (ISO date strings) designed to drive other blocks’ layout or chart tick marks. This Data Block is part of Assette’s charting helper Data Blocks, allowing content creators to control and customize time intervals on a chart. It serves as a helper utility to determine date markers (ticks) that can be applied as axis labels and gridlines within PowerPoint.
Purpose and Usage #
This block helps users:
- Generate time intervals dynamically based on input parameters such as account history or chart size
- Create major/minor tick marks for use in charts (e.g., monthly, quarterly, annual intervals)
- Support flexible rendering across different chart sizes and data ranges
- Power Smart Shells or other template components that depend on time-based scaling
Note: This Data Block does not generate charts. It is intended to be used as a data source for other Data Blocks or Data Objects that consume its output to drive visual rendering in templates.
General Info #
Attribute | Value |
---|---|
Name | ast_fn_GetMajorMinorTicker |
Block Category | Interface |
Block Type | Python |
Output Type | Data Table |
Editable | False |
Public Block | True |
Dependencies #
Data Block | Description |
---|---|
PythonEnvForDateCalculation | Used to import Python libraries and modules for date calculations. [Link] |
Columns #
N/A
Request Parameters #
This block accepts the following parameters to customize the output:
Parameter | Description |
---|---|
begin_date | The start date of the time window, in YYYY-MM-DD format. The first period in the output is calculated from this date forward. |
as_of_date | The end date of the time window, in YYYY-MM-DD format. The last period in the output is guaranteed to align with this date, even if it does not naturally fall on a frequency boundary. |
size | A qualitative indicator of dataset scale (small, mid, or large). Used only when display_frequency = “auto” to determine how frequently ticks should be emitted. |
display_frequency | Determines how dates are generated: • “auto” → System auto-selects frequency based on size and elapsed time window.• “monthly” → Returns month-end dates. • " quarterly" → Returns quarter-end dates.• “annually” / “yearly” → Returns year-end dates. |
These inputs allow downstream blocks to create context-aware axis markings that adjust based on history length, chart size, or user configuration.
How It Works #
The Get Major Minor Ticker (ast_fn_GetMajorMinorTicker) Data Block generates a sequence of dates (“ticks”) between a begin_date and an as_of_date. These ticks serve as anchor points for downstream Data Blocks or Data Objects that render time-based visuals. The behavior of the block is governed by the four request parameters:
begin_date
- This sets the starting point of the time window.
- The output sequence always begins from this date (or the nearest valid period boundary after it).
- Example: if begin_date = 2023-01-01 and display_frequency = quarterly, the first period will be 2023-03-31 (end of Q1).
as_of_date
- This sets the ending point of the time window.
- The output sequence always includes this date, even if it doesn’t fall exactly on a frequency boundary.
- Example: if as_of_date = 2025-06-30 and display_frequency = annually, the output will include 2025-06-30 even though it is not a year-end.
size
- Used only when display_frequency = auto.
- Represents the scale of the dataset and determines how coarsely or finely ticks are spaced over time.
- The logic evaluates the age in years between begin_date and as_of_date and then applies different rules for
small
,mid
, orlarge
datasets:- Small datasets: More frequent ticks (quarterly, annually, or biennial depending on age).
- Mid datasets: Moderate spacing (monthly, quarterly, semi-annual, or auto multi-year).
- Large datasets: Coarser spacing (monthly, quarterly, semi-annual, or multi-year intervals).
- Example:
- If
size = small
and the period covers 7 years, ticks may be biennial. - If
size = large
and the period covers 12 years, ticks may be every 2+ years.
- If
display_frequency
- Dictates how ticks are generated:
- Explicit values:
"monthly"
→ Returns month-end dates."quarterly"
→ Returns quarter-end dates."annually"
/"yearly"
→ Returns year-end dates.
- Auto-calculation (
auto
):- The block examines
size
+ elapsed years to select a frequency. - Possible outcomes: monthly, quarterly, semi-annual, annual, biennial, or a multi-year custom interval.
- The block examines
- Explicit values:
- Example:
- If
display_frequency = monthly
, the output is every month-end betweenbegin_date
andas_of_date
. - If
display_frequency = auto
, the output adapts intelligently to the dataset size and time span.
- If
Example Use Cases #
The following examples demonstrate how the ast_fn_GetMajorMinorTicker Data Block responds to different parameter combinations. In all cases, the time window is defined as:
as_of_date = "2025-07-30"
begin_date = "2020-06-30"
Example 1: Auto Frequency with Small Dataset #
Request Parameters
This request asks the block to automatically determine frequency for a small dataset over ~5 years. According to the Advanced rules, this yields a biennial cadence.
{
"begin_date": "2020-06-30",
"as_of_date": "2025-07-30",
"size": "small",
"display_frequency": "auto"
}
Response
The block emits biennial year-end ticks with the as_of_date appended.
{
"data": [
{ "Period": "2020-12-31" },
{ "Period": "2022-12-31" },
{ "Period": "2024-12-31" },
{ "Period": "2025-07-30" }
]
}
Example 2: Auto Frequency with Mid Dataset #
Request Parameters
This request asks for an automatic cadence for a mid dataset over ~5 years. Advanced rules result in a semi-annual cadence.
{
"begin_date": "2020-06-30",
"as_of_date": "2025-07-30",
"size": "mid",
"display_frequency": "auto"
}
Response
The block generates semi-annual ticks (June 30 and December 31), plus as_of_date.
{
"data": [
{ "Period": "2020-06-30" },
{ "Period": "2020-12-31" },
{ "Period": "2021-06-30" },
{ "Period": "2021-12-31" },
{ "Period": "2022-06-30" },
{ "Period": "2022-12-31" },
{ "Period": "2023-06-30" },
{ "Period": "2023-12-31" },
{ "Period": "2024-06-30" },
{ "Period": "2024-12-31" },
{ "Period": "2025-06-30" },
{ "Period": "2025-07-30" }
]
}
Example 3: Auto Frequency with Large Dataset #
Request Parameters
For a large dataset over ~5 years, the block also selects a semi-annual cadence.
{
"begin_date": "2020-06-30",
"as_of_date": "2025-07-30",
"size": "large",
"display_frequency": "auto"
}
Response
Semi-annual ticks are returned, identical in behavior to the mid-size example.
{
"data": [
{ "Period": "2020-06-30" },
{ "Period": "2020-12-31" },
{ "Period": "2021-06-30" },
{ "Period": "2021-12-31" },
{ "Period": "2022-06-30" },
{ "Period": "2022-12-31" },
{ "Period": "2023-06-30" },
{ "Period": "2023-12-31" },
{ "Period": "2024-06-30" },
{ "Period": "2024-12-31" },
{ "Period": "2025-06-30" },
{ "Period": "2025-07-30" }
]
}
Example 4: Explicit Monthly Frequency #
Request Parameters
This request forces monthly ticks. The size
parameter is ignored.
{
"begin_date": "2020-06-30",
"as_of_date": "2025-07-30",
"size": "small",
"display_frequency": "monthly"
}
Response
The block generates every month-end date from June 2020 to June 2025, with the as_of_date
appended.
{
"data": [
{ "Period": "2020-06-30" },
{ "Period": "2020-07-31" },
{ "Period": "2020-08-31" },
...
{ "Period": "2025-06-30" },
{ "Period": "2025-07-30" }
]
}
Example 5: Explicit Quarterly Frequency #
Request Parameters
This request forces quarter-end ticks. The size
parameter is ignored.
{
"begin_date": "2020-06-30",
"as_of_date": "2025-07-30",
"size": "mid",
"display_frequency": "quarterly"
}
Response
The block generates quarter-end dates (March 31, June 30, September 30, December 31) and appends the as_of_date
.
{
"data": [
{ "Period": "2020-06-30" },
{ "Period": "2020-09-30" },
{ "Period": "2020-12-31" },
...
{ "Period": "2025-06-30" },
{ "Period": "2025-07-30" }
]
}
Example 6: Explicit Annual Frequency #
Request Parameters
This request forces annual ticks. The size
parameter is ignored.
{
"begin_date": "2020-06-30",
"as_of_date": "2025-07-30",
"size": "large",
"display_frequency": "annually"
}
Response
The block generates year-end dates from 2020 to 2024, plus the as_of_date
.
{
"data": [
{ "Period": "2020-12-31" },
{ "Period": "2021-12-31" },
{ "Period": "2022-12-31" },
{ "Period": "2023-12-31" },
{ "Period": "2024-12-31" },
{ "Period": "2025-07-30" }
]
}
Best Practices #
When configuring and using the Data Block, keep the following guidelines in mind to ensure accurate and efficient results:
1. Always Use the Correct Date Format
- Both begin_date and as_of_date must be in the format YYYY-MM-DD.
- This avoids parsing errors and ensures consistent results across downstream Data Blocks.
2. Set a Meaningful Date Window
- Choose begin_date and as_of_date that reflect the actual reporting or analysis period.
- Avoid excessively long ranges unless needed; larger ranges can generate long date lists, which may impact performance when consumed by downstream blocks.
3. Use “auto” Frequency for Flexibility
- When the correct spacing isn’t obvious, set display_frequency = “auto”.
- The block will intelligently choose spacing based on the dataset size (small, mid, large) and the elapsed years between dates.
- This reduces manual tuning and helps keep tick marks readable in charts or tables.
4. Use Explicit Frequencies for Control
- If your reporting standard requires monthly, quarterly, or annual views, set display_frequency explicitly.
- Explicit settings override
size
, ensuring predictable alignment to month, quarter, or year boundaries.
5. Match Frequency to Visualization Needs
- Use monthly only when short-term precision is needed; otherwise, it can clutter visuals.
- Use quarterly or annually for long-range reporting where clarity is more important than detail.
- Use auto when your audience varies, allowing the block to adapt intelligently.
6. Use as a Dependency in other Data Blocks
- Remember that this block does not produce charts directly.
- Its best use is as a data source for ticks or labels in downstream Data Blocks that render time-series visualizations.