Omniscope Custom Blocks › Analytics/Period-Comparison

Period Comparison

Builds the standard month / QTD / YTD / moving annual total comparison versus prior periods per group, with a fiscal year start of your choice, plus a monthly trend table.

Analytics › Finance Python visokio-agents

Open the demo in Omniscope Download demo.ioz Sample data: daily-sales.csv Source on GitHub

Items tagged visokio-agents are community examples built by Visokio's agents, to extend Omniscope's core blocks and views with popular, specialist and more unusual use cases, and to show what anyone, people or agents, can build on Omniscope. They are tested by automated tests and were run on a real Omniscope server. They were not reviewed by Omniscope's core team, so they are not on a par with the core blocks and views, which have years of manual, functional and unit tests behind them. About

Omniscope custom block · Analytics

This month, last year, year to date and moving annual total, with variances, per region or product, from raw transactions in one block. Fiscal years starting in April welcome.

Python · pandas, numpy · nothing extra to install

The problem it solves

Monthly packs typically start with the same table: this month against last month and the same month last year, year to date against last year, and the last twelve months against the twelve before. Building it means date arithmetic, fiscal-year logic and a page of formulas, and it breaks every January (or April).

Period Comparison produces the whole table from transactions as at the latest complete month (or any date you choose), with a fiscal year start of your choice, a total row and a monthly trend table.

How it works

What goes in

Daily sales

Synthetic daily sales for three regions and two channels, January 2023 to October 2025.

Date Region Channel Sales
2023-01-01 North Stores 891.93
2023-01-01 North Online 322.39
2023-01-01 South Stores 985.51
2023-01-01 South Online 354.62
2023-01-01 Scotland Stores 421.86
2023-01-01 Scotland Online 210.8

6,210 rows in the sample file.

The options

Option Demo setting What it does
Date field Date Date of each value.
Value field Sales Sales, revenue, units, cost...
Group by (optional) Region One comparison per value, such as Region.
Fiscal year starts in month 4 1 = January, 4 = April.
Use the latest complete month On When no reporting date is set and the last month in the data is partial, report the month before.

What comes out

Period comparison (October 2025)

Region Month Same Month Last Year % Change vs Last Year YTD Prior YTD % Change YTD vs Last Year MAT Prior MAT % Change MAT vs Prior MAT
North 36,852.32 33,931.66 0.086 207,466.89 195,128.36 0.063 376,067.36 352,482.02 0.067
Scotland 16,056.93 16,021.66 0.002 94,339.91 94,002.24 0.004 173,772.12 172,273.64 0.009
South 54,737.06 51,459.85 0.064 315,795.38 289,676.43 0.09 569,784.89 520,014.65 0.096
Total 107,646.31 101,413.17 0.061 617,602.18 578,807.03 0.067 1,119,624.37 1,044,770.31 0.072

Monthly trend (North, last six months)

Region Month Value Same Month Last Year % Change vs Last Year YTD MAT Fiscal Year
North 2025-05 26,391.09 25,364.15 0.04 53,843.50 366,516.12 FY 2025/26
North 2025-06 26,085.33 23,757.74 0.098 79,928.83 368,843.71 FY 2025/26
North 2025-07 27,649.26 26,058.93 0.061 107,578.09 370,434.04 FY 2025/26
North 2025-08 30,978.12 29,194.34 0.061 138,556.21 372,217.82 FY 2025/26
North 2025-09 32,058.36 31,129.48 0.03 170,614.57 373,146.70 FY 2025/26
North 2025-10 36,852.32 33,931.66 0.086 207,466.89 376,067.36 FY 2025/26
Month, YTD and MAT growth side by side: the month can mislead, MAT shows the underlying trend (synthetic data).
Month, YTD and MAT growth side by side: the month can mislead, MAT shows the underlying trend (synthetic data).

Month, YTD and MAT growth side by side: the month can mislead, MAT shows the underlying trend (synthetic data).

Moving annual total from the trend output: seasonality removed, growth visible.
Moving annual total from the trend output: seasonality removed, growth visible.

Moving annual total from the trend output: seasonality removed, growth visible.

Where it pays off

Finance: Monthly management pack

The standard month / YTD / MAT table by business unit, regenerated automatically at each month end.

Retail and hospitality: Like-for-like trading

Sales by store or region against last year and year to date, a table many trading meetings start with.

Public sector and charities: Fiscal year reporting

April-to-March year-to-date income, spend or activity against the previous year, without hand-built date logic.

SaaS: Bookings and usage

MAT of bookings or usage per product line to see growth through seasonal noise.

Use cases describe typical scenarios and are illustrative.

Why do this in Omniscope

How it fits into an Omniscope workflow

Transactions (Database) → Period Comparison → Report

Feed transactions or daily totals. Add a Record filter before it for one business unit, or group by several fields for a deeper cut.

Show the comparison output as the pack's first table and the trend output as line charts; schedule it for month end.

In one step

Month, quarter-to-date, year-to-date and moving annual total, including fiscal years and the latest-complete-month rule.

Try it

  1. Open the demo project (demo.iox on the demo server, or import demo.ioz from this folder): nearly three years of daily sales by region.
  2. The question: how did October do against last year, and how is the fiscal year going?
  3. Open Period Comparison: date, value, group by Region, fiscal year from April. Run it.
  4. Look at the comparison table with the total row: YTD +6.7% and MAT +7.2%; the South grows fastest while Scotland is flat.
  5. Look at the trend output as a MAT line chart. When next month's data arrives, the workflow updates both outputs.

Running in Omniscope

Omniscope workflow
Omniscope workflow

The demo project's workflow: the sample data, the block, and a Validate data check on its output.

Language and libraries

Python. It uses pandas and numpy.

pandas and numpy are part of Omniscope's Docker Python image, and the block was run in both host mode and Docker mode on an Omniscope server, with the same results. It needs nothing else installed.

Tested

The demo workflow completed without errors on an Omniscope server (4 records in Period comparison and 102 in Monthly trend). Automated tests check normal data, empty input, wrong types and large input.

Reference

Fields it reads

NameTypeWhat it does
Date fieldFieldDate of each value.
Value fieldFieldSales, revenue, units, cost...
Group by (optional)FieldsOne comparison per value, such as Region.

Options

NameTypeWhat it does
Reporting date (optional)TextAny date in the reporting month, such as 2025-09-30. Empty = latest complete month in the data.
Fiscal year starts in monthWhole number1 = January, 4 = April.
Use the latest complete monthYes / noWhen no reporting date is set and the last month in the data is partial, report the month before.

Outputs

OutputWhat it holds
ComparisonPer group (and total): month, prior month, same month last year, QTD, YTD, MAT and their comparators, with changes.
Monthly trendPer group and month: value, same month last year, % change, YTD, MAT, fiscal year.