Omniscope Custom Blocks › Analytics/Price-Index

Price Index

Laspeyres, Paasche and Fisher price indices, value and volume indices from item prices and quantities per period, per group.

Analytics › Finance Python visokio-agents

Open the demo in Omniscope Download demo.ioz Sample data: purchases.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

Build your own price index (Laspeyres, Paasche, Fisher) from item prices and quantities, and split spend growth into price and volume.

Python · pandas, numpy · nothing extra to install

The problem it solves

Published inflation figures rarely match what a business actually buys or sells. Procurement and finance teams want their own cost index: how much have prices for our basket risen, and how much of the spend increase is price versus volume?

This block computes the standard index formulas from item prices and quantities per period, with a value index and the implied volume index alongside.

How it works

What goes in

Purchases

Invented prices and quantities, 2021 to 2025.

Year Item Unit Price (GBP) Quantity
2021 Cardboard boxes 0.813 50104
2021 Pallets 9.064 2237
2021 Stretch film 14.036 902
2021 Diesel (litres) 1.421 61490
2021 Labels (thousand) 6.622 1233
2021 Tape (rolls) 1.901 8370

30 rows in the sample file.

The options

Option Demo setting What it does
Item field Item Identifies an item whose price is tracked.
Period field Year The period of each price and quantity, such as Year.
Unit price field Unit Price (GBP) Price paid per unit.
Quantity field Quantity Units bought, used to weight the items.
Base period (first) Default: the first period.

What comes out

Index

Period Items Compared Items Missing Laspeyres Paasche Fisher Value Index Implied Volume Index Fisher Change From Previous
2021 6 0 100 100 100 100 100
2022 6 0 120.60 119.91 120.25 115.52 96.06 0.2
2023 6 0 119.59 119.35 119.47 117.27 98.16 -0.01
2024 6 0 115.31 115.70 115.50 109.87 95.12 -0.03
2025 6 0 115.26 115.77 115.52 109.22 94.55 0
Laspeyres and Paasche stay within a point of each other: the mix of purchases changed little (invented data).
Laspeyres and Paasche stay within a point of each other: the mix of purchases changed little (invented data).

Laspeyres and Paasche stay within a point of each other: the mix of purchases changed little (invented data).

Prices are up about 16% on 2021 but spend only 9%: volume fell by about 5% (invented data).
Prices are up about 16% on 2021 but spend only 9%: volume fell by about 5% (invented data).

Prices are up about 16% on 2021 but spend only 9%: volume fell by about 5% (invented data).

Where it pays off

Procurement: Own cost index

How much prices of the goods and services you buy have risen, compared with published indices and contract escalators.

Retail and pricing: Selling price index

Average price movement across the range, separated from mix and volume.

Finance: Price and volume variance

Split year-on-year spend or revenue change into price and volume at basket level.

Public sector: Unit cost tracking

Cost indices for frequently bought items, per directorate or supplier.

Use cases describe typical scenarios and are illustrative.

Why do this in Omniscope

How it fits into an Omniscope workflow

Purchase or sales lines → Price Index → Inflation Adjustment (use the index) → Report

Aggregate lines to item and period, or let the block combine them; Price-Volume-Mix Bridge gives the item-level revenue bridge.

Use the Fisher column as the index table for Inflation Adjustment.

The index feeds Inflation Adjustment directly in the workflow, so a new purchase extract updates the indices and everything adjusted by them in one run.

In one step

Laspeyres, Paasche and Fisher indices, plus value and volume indices.

Try it

  1. Open the demo project (demo.iox on the demo server, or import demo.ioz from this folder): invented purchase prices and quantities for six items.
  2. The question: how much have our packaging and transport costs really gone up?
  3. Run the block with 2021 as the base.
  4. Look at the index: Fisher 116 in 2025; spend 109; volume 95.
  5. Note how close Laspeyres and Paasche are: the mix barely shifted, so the choice of formula matters little for this basket.

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

Run on an Omniscope server, the demo workflow finished without errors (5 records in Index). Automated tests also cover the index formulas on known values, groups and the base period, the sample data, and bad options.

Reference

Fields it reads

NameTypeWhat it does
Item fieldFieldIdentifies an item whose price is tracked.
Period fieldFieldThe period of each price and quantity, such as Year.
Unit price fieldFieldPrice paid per unit.
Quantity fieldFieldUnits bought, used to weight the items.
One index per (optional)Field

Options

NameTypeWhat it does
Base periodTextDefault: the first period.

Outputs

OutputWhat it holds
IndexPer group and period: items compared and missing, Laspeyres, Paasche, Fisher, value and volume indices, change.