Omniscope Custom Blocks › Preparation/Tile

Tile

Assigns records to tiles of a numeric field: quantiles, equal-sum Pareto bands, equal width, standard-deviation bands or manual cut points, optionally within groups.

Preparation › Binning Python visokio-agents

Open the demo in Omniscope Download demo.ioz Sample data: customer-revenue.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 · Preparation

Quartiles, deciles, Pareto bands, standard-deviation bands or your own cut points, in one block and within groups if you like. Find out how few customers make most of the revenue.

Python · pandas, numpy · nothing extra to install

The problem it solves

Banding a measure is one of the most common steps in analysis: revenue deciles for targeting, Pareto bands for account management, price bands for range reviews, risk bands for credit. Equal-width buckets are easy with a formula, but quantiles and equal-sum bands need sorting, running totals and thresholds per group.

Tile does it in one step with five methods, and summarises each tile so the story is immediate.

How it works

What goes in

Customer revenue

200 synthetic customers with a typical long-tailed revenue distribution.

Customer ID Region Segment Annual Revenue Orders
CUST-0001 North Mid-market 24384 18
CUST-0002 North Mid-market 6272 1
CUST-0003 Midlands SME 7680 6
CUST-0004 South Enterprise 8430 34
CUST-0005 Scotland SME 890 19
CUST-0006 Scotland SME 2380 56
CUST-0007 North SME 3360 47
CUST-0008 South SME 1170 3

200 rows in the sample file.

The options

Option Demo setting What it does
Value field Annual Revenue The numeric field to tile.
Method Equal sum (Pareto bands) How the tile boundaries are set.
Number of tiles 4 4 for quartiles, 10 for deciles, 100 for percentiles. Not used by smart and manual tiles.
Tile 1 = highest values On Untick for tile 1 = lowest values.

What comes out

Tiled data (highest revenue first)

Customer ID Region Segment Annual Revenue Tile Number Tile Range
CUST-0111 North SME 263400 1 64,320 to 263,400
CUST-0074 North Mid-market 75888 1 64,320 to 263,400
CUST-0159 South Enterprise 66930 1 64,320 to 263,400
CUST-0097 North Mid-market 66096 1 64,320 to 263,400
CUST-0078 Scotland SME 64320 1 64,320 to 263,400
CUST-0171 Midlands SME 61100 2 19,740 to 61,100
CUST-0169 Midlands Mid-market 58944 2 19,740 to 61,100
CUST-0088 South SME 47470 2 19,740 to 61,100

Tile summary: equal sum

Tile Number Records Minimum Maximum Total Share Of Total Share Of Records
1 5 64,320 263,400 536,634 0.252 0.025
2 15 19,740 61,100 527,200 0.248 0.075
3 39 9,280 18,256 536,110 0.252 0.195
4 141 800 9,230 527,718 0.248 0.705

Tile summary: equal records (quartiles), for comparison

Tile Number Records Minimum Maximum Total Share Of Total Share Of Records
1 50 10,650 263,400 1,510,984 0.71 0.25
2 50 5,060 10,620 370,840 0.174 0.25
3 50 2,260 4,970 175,688 0.083 0.25
4 50 800 2,140 70,150 0.033 0.25
Equal-sum tiles: a handful of customers make up the first quarter of revenue, while the last quarter needs most of the customer base (synthetic data).
Equal-sum tiles: a handful of customers make up the first quarter of revenue, while the last quarter needs most of the customer base (synthetic data).

Equal-sum tiles: a handful of customers make up the first quarter of revenue, while the last quarter needs most of the customer base (synthetic data).

Equal-record tiles (quartiles) tell the same story from the other side.
Equal-record tiles (quartiles) tell the same story from the other side.

Equal-record tiles (quartiles) tell the same story from the other side.

Where it pays off

B2B sales: Account tiering

Equal-sum bands decide which accounts get a named account manager, which get inside sales and which go to self-service, and re-tier automatically each quarter.

Retail and e-commerce: Customer deciles for targeting

Decile customers by spend within each region or channel, then target the top deciles with loyalty offers and the middle ones with reactivation campaigns.

Financial services: Risk and balance bands

Manual cut points turn balances, loan-to-value or scores into the bands regulators and credit committees use, consistently across every report.

Supply chain: Inventory value bands

Equal-sum tiles on stock value show the small set of lines that ties up most working capital (a quick start towards ABC classification).

Use cases describe typical scenarios and are illustrative.

Why do this in Omniscope

How it fits into an Omniscope workflow

Customers (Database) → Aggregate (revenue per customer) → Tile → Report

Aggregate to one row per customer (or product, or store) first, then Tile. Join the tile back to transactions if you need it at row level.

Use the summary output directly in a Report for the Pareto story, and the tiled data for segment filters.

The tile fields can be used as filters and selections in the Report, so choosing a segment cuts every view to it.

In one step

All the common tiling methods, plus tiling within groups and a ready-made summary.

Try it

  1. Open the demo project (demo.iox on the demo server, or import demo.ioz from this folder): 200 customers and their annual revenue.
  2. The question: how many customers make up the first quarter of our revenue?
  3. Open the Tile block: Annual Revenue, method Equal sum, 4 tiles, tile 1 = highest. Run it.
  4. Look at the summary output: 5 customers make the first quarter of revenue and 141 make the last. That is the account-management conversation.
  5. Switch the method to Equal records to get quartiles, or add Region as a group for deciles per region: one option, no formulas.

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, plus the Python standard library (re).

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 runs without errors on an Omniscope server and produces 200 records in Tiled data and 4 in Tile summary. Its automated tests cover normal data, empty input, wrong types and large input.

Reference

Fields it reads

NameTypeWhat it does
Value fieldFieldThe numeric field to tile.
Within groups (optional)FieldsTile separately within each combination of these fields.

Options

NameTypeWhat it does
MethodChoiceHow the tile boundaries are set.
Number of tilesWhole number4 for quartiles, 10 for deciles, 100 for percentiles. Not used by smart and manual tiles.
Manual cut pointsTextComma-separated upper bounds, such as 1000, 5000, 20000 (values equal to a cut point go to the next tile up).
Tile 1 = highest valuesYes / noUntick for tile 1 = lowest values.
Name of new fieldsTextNew fields are '<name> Number' and '<name> Range'.

Outputs

OutputWhat it holds
TiledThe input with Tile Number and Tile Range (or Tile Label).
SummaryOne row per (group and) tile: records, minimum, maximum, total, share of total, share of records.