Omniscope Custom Blocks › Analytics/Concentration-Measures

Concentration Measures

HHI, Gini, top-N and top-20% shares and Lorenz curves for customer, supplier or market concentration, per group.

Analytics › Finance Python visokio-agents

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

How concentrated is your revenue, spend or market? HHI, Gini, top-N shares and Lorenz curves, overall and per year or market.

Python · pandas, numpy · nothing extra to install

The problem it solves

Dependence on a few customers or suppliers is a risk that finance, procurement and auditors all ask about, and market concentration is a standard competition measure. The numbers are simple once you have shares, but tracking them consistently by year, market or category is fiddly.

This block sums each entity, then gives the standard measures (HHI and its equivalent number of equal-sized entities, Gini, top-1, top-4, top-10 and top-20% shares, entities for 50% and 80%) and a Lorenz curve per group.

How it works

What goes in

Supplier spend

Invented spend lines for 240 suppliers over three years.

Year Supplier Spend (GBP)
2023 SUP1000 1602.33
2023 SUP1000 1409.29
2023 SUP1000 1192.16
2023 SUP1001 26055.12
2023 SUP1001 19933.71
2023 SUP1001 18416.47

2,079 rows in the sample file.

The options

Option Demo setting What it does
Entity field Supplier For example Customer, Supplier or Company.
Value field Spend (GBP) For example Revenue or Spend.
Per group (optional) Year For example Year or Market.
HHI: moderately concentrated from 1500 HHI at or above this is labelled moderately concentrated.
HHI: highly concentrated above 2500 HHI above this is labelled highly concentrated.

What comes out

Measures by year

Year Entities Total HHI Normalised HHI Equivalent Equal Entities Gini Top 1 Share Top 4 Share (CR4) Top 10 Share Top 20% Of Entities Share Entities For 50% Entities For 80% HHI Band Largest Entity
2023 240 5,467,153 201 0.016 50 0.658 0.074 0.209 0.358 0.702 21 73 Unconcentrated SUP1136
2024 240 4,983,880 197 0.016 51 0.653 0.076 0.206 0.356 0.694 21 74 Unconcentrated SUP1136
2025 213 3,984,198 242 0.02 41 0.648 0.101 0.229 0.376 0.692 19 67 Unconcentrated SUP1136

Largest suppliers in 2025

Year Supplier Value Share Rank Cumulative Share In Top 20%
2025 SUP1136 403,767.09 0.1013 1 0.1013 Yes
2025 SUP1043 241,532.02 0.0606 2 0.162 Yes
2025 SUP1107 141,563.01 0.0355 3 0.1975 Yes
2025 SUP1113 126,172.06 0.0317 4 0.2292 Yes
2025 SUP1035 122,503.22 0.0307 5 0.2599 Yes
2025 SUP1021 115,750.48 0.0291 6 0.289 Yes
2025 SUP1103 96,584.02 0.0242 7 0.3132 Yes
2025 SUP1231 95,160.67 0.0239 8 0.3371 Yes
The further the curve bows below the diagonal, the more unequal the spend (illustrative data).
The further the curve bows below the diagonal, the more unequal the spend (illustrative data).

The further the curve bows below the diagonal, the more unequal the spend (illustrative data).

Consolidating onto preferred suppliers and dropping part of the tail raised the HHI in 2025, while the Gini barely moved: the two measure different things.
Consolidating onto preferred suppliers and dropping part of the tail raised the HHI in 2025, while the Gini barely moved: the two measure different things.

Consolidating onto preferred suppliers and dropping part of the tail raised the HHI in 2025, while the Gini barely moved: the two measure different things.

Where it pays off

Finance and audit: Customer concentration

Share of revenue from the largest customers, tracked by year, for risk reporting and lender covenants.

Procurement: Supplier dependence

Spend concentration by category, before and after a consolidation programme.

Competition and strategy: Market structure

HHI and CR4 by market from market-share data, with your own band thresholds.

Retail: Range concentration

How much of sales the top products carry, per store or category (see also ABC Classification).

Use cases describe typical scenarios and are illustrative.

Why do this in Omniscope

How it fits into an Omniscope workflow

Transactions or market shares → Concentration Measures → Report (Lorenz curve, trend)

Feed transactions with an entity and value; group by year to see the trend. ABC Classification gives the class of each entity.

Chart Share Of Total against Share Of Entities with the Equality Line for the Lorenz curve.

In one step

HHI, Gini, top-N shares and the Lorenz curve, side by side for every group.

Try it

  1. Open the demo project (demo.iox on the demo server, or import demo.ioz from this folder): three years of invented supplier spend.
  2. The question: are we becoming more dependent on a few suppliers?
  3. Open the block: Supplier, Spend, per Year. Run it.
  4. Look at the measures: HHI from 201 to 242, active suppliers from 240 to 213, top four now 23%.
  5. Look at the Lorenz curve: Gini barely moved while HHI rose: HHI goes up as the number of suppliers falls, while Gini measures how unequal the remaining ones are.

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 (3 records in Summary, 303 in Lorenz curve and 693 in Entities). Automated tests check normal data, empty input, wrong types and large input.

Reference

Fields it reads

NameTypeWhat it does
Entity fieldFieldFor example Customer, Supplier or Company.
Value fieldFieldFor example Revenue or Spend.
Per group (optional)FieldsFor example Year or Market.

Options

NameTypeWhat it does
HHI: moderately concentrated fromNumberHHI at or above this is labelled moderately concentrated.
HHI: highly concentrated aboveNumberHHI above this is labelled highly concentrated.

Outputs

OutputWhat it holds
SummaryPer group: entities, total, HHI, normalised HHI, equivalent entities, Gini, top shares, entities for 50% / 80%, band.
LorenzPer group: 101 points of cumulative share of entities vs cumulative share of total.
EntitiesPer group and entity: value, share, rank, cumulative share, in top 20%.