Translating codes — Mapping tables
A Link matches a source column to a dimension by item
code. That works when both sides agree on the coding — and they usually
don't. Your accounting system exports account 620100; your P&L has a line
called OPEX. Nothing in the Link can bridge that gap, so every row lands
nowhere.
A Mapping table is the bridge: a saved list of rules, each one saying this source code becomes that destination item. You build it once in the Data section and point as many Links at it as you like.
Mapping tables used to be called allocation tables, and the assistant's tools still accept that older name. They are the same thing. A mapping table translates codes only: it moves no amounts between items, so it is not cost allocation.
| Match | Destination | Sign |
|---|---|---|
620100 |
OPEX |
= |
620200 |
OPEX |
= |
70* |
REVENUE |
− |
64*, !6411* |
PAYROLL |
= |

Two source codes can map to the same destination — that is how a detailed chart of accounts collapses into a reporting line. Rows landing on the same cell sum, exactly as they would without a mapping.
The sign
Each rule also decides what happens to the value:
- = passes it through unchanged;
- − inverts it. This is the workhorse for accounting sources, which commonly deliver revenue and liabilities as credits — negative numbers you want positive in a report;
- abs takes the magnitude, for sources whose polarity is inconsistent.
How a code is matched
Each rule's Match cell says which source values it takes. It holds one pattern, or several separated by commas:
| Pattern | Matches | Example |
|---|---|---|
ABC |
exactly that code | 607110 |
ABC* |
codes that start with it | 62* |
*ABC |
codes that end with it | *00 |
*ABC* |
codes that contain it | *706* |
* |
anything that is not blank | * |
<blank> |
an empty or missing cell | <blank> |
A * may only open or close a pattern — 6*0 is refused when you save —
and there are no regular expressions. Patterns only work on the source
side; a pattern in the destination column matches nothing.
One rule, with exceptions
Chart-of-accounts mappings are usually written as "these accounts, except
those". A Match cell says exactly that: list the patterns the rule takes,
then the ones it doesn't, each marked with a leading !.
6*, 7*, !68*— every 6 and 7 account, except the 68s.*, !*706*, !*707*— everything, except codes containing 706 or 707.
The value has to match any of the plain patterns and none of the !
ones. Order inside the cell doesn't matter. (In the rare code that really
starts with ! or contains a comma, write \! or \,.)
Because the exceptions live inside the rule, a value a rule excludes simply falls to whichever other rule matches it — or is reported as unmatched if none does. Two rules like these give the same result in either order:
| Match | Destination |
|---|---|
131000|6*, 131000|7*, !131000|68* |
L40 |
131000|68* |
L41 |
131000|606100 and 131000|706000 land on L40; 131000|681120 is
excluded from the first rule and lands on L41. (The | here is part of the
code: the source column joins a cost centre and an account into one key, e.g.
with a transform CONCAT([Cost_Center], "|", [Account]).)
Which rule wins
- An exact code wins. A rule that lists the value itself —
607110beside6*— beats every pattern rule, wherever it sits and even if a broader rule excludes that code. Carving one account out of a pattern this way is normal; the editor notes it in grey, it is not a warning. - Otherwise the first matching rule wins. If
6*sits above62*, the broader rule catches everything and62*never fires — the editor warns that the later rule is shadowed. With exceptions inside rules, order rarely matters any more; when it does, put the specific rule first or add an exception to the broad one. - A rule whose exceptions cover everything it includes never matches
(
68*, !6*), and the editor warns about it. - Blank cells need their own rule. Write
<blank>on the source side to say where empty or missing source values go. No pattern, not even*, matches a blank — a blank code is usually a subtotal or header row you want to see, not fold into a catch-all. The same token works without a mapping table: a column matched directly to a dimension lands its blank cells on the item coded<blank>, if the dimension has one. - Case never matters, on either side.
620100matches whatever the source sends, andopexfinds anOPEXitem on the destination dimension. What the destination code still has to be is a real item code on that dimension — a destination that names no item skips those rows, and the run reports them as unmatched.
Split by balance sign
Some accounts don't belong on one statement line — they belong on one of
two, depending on which way the balance sits. A bank account
(512*) is normally an asset, but the same account overdrawn is a liability.
A customer account (411*) is normally a receivable, but a customer who
prepaid sits on the liability side as a credit received. A single rule with a
sign column can't express that, because the sign column only changes the
value, never the destination.
Split by balance sign is a second, conditional destination on the same row: the row's per-row "Split by balance sign" toggle reveals a second destination and a second sign, and the two columns are labelled Debit balance and Credit balance. A balance ≥ 0 (a debit) goes to the row's main destination; a balance < 0 (a credit) goes to the credit-branch destination instead. Zero never routes anywhere, because a zero balance writes nothing regardless.
The five families that come up constantly under a French chart of accounts (PCG art. 121-3, the non-compensation rule):
| Accounts | Debit balance → | Credit balance → |
|---|---|---|
512* banks |
Disponibilités (asset) | Concours bancaires courants (liability) |
451* / 455* group and associates |
Autres créances (asset) | Emprunts et dettes financières diverses (liability) |
401* suppliers |
Fournisseurs débiteurs — avances et acomptes versés (asset) | Dettes fournisseurs (liability) |
411* customers |
Créances clients (asset) | Clients créditeurs — avances et acomptes reçus (liability) |
444* income tax |
État, IS — créance (asset) | État, IS — dette (liability) |
On the liability side, set the credit branch's sign to invert: the
underlying balance is negative and a liability line should display positive.
abs works too but is redundant once a branch only ever sees one sign.
This only means anything against a stock, not a movement — the mapping table has to see each account's closing balance, not one journal line at a time. That's why a split row is only valid on a Data-Table Link running in Closing balances mode (see Build financial statements from a ledger export for how that mode groups rows into per-account balances before matching). Anywhere else — a movements link, or a URL, file or integration link — a table containing a split row is refused outright, with an error naming the link or the import path, rather than silently applying the debit branch to everything.
Two things to watch for once a table has split rows:
- The AI/MCP "merge" update mode replaces a whole entry. If you merge in an update to a split row's debit branch without resending the credit branch, the credit branch is dropped, not kept. Send both branches every time you touch the row through the API or an AI tool.
- Copying rows out of the grid and pasting them back keeps only the debit
side. (A whole Match rule —
6*, 7*, !68*— does travel: it is one tab-separated cell.) The credit branch doesn't travel through copy-paste, so a round-tripped row loses its split silently — re-check the toggle after pasting.
Dropping rows on purpose
Sometimes a value must be claimed — so it doesn't fall into a later
catch-all — but not written anywhere. Map it to the reserved destination
<exclude>:
| Match | Destination |
|---|---|
120001|707* |
<exclude> |
120001|* |
L99 |
Rows the first rule matches are dropped: they are never written, they are
not reported as unmatched, and <exclude> never triggers the "not an item
code" warning. The Link preview and every run count them separately, as
excluded (number of rows and their sum), so the source still reconciles.
Use this instead of inventing a fake destination code.
When a code isn't matched
Nothing goes wrong loudly. A source value with no matching rule is skipped — its row simply doesn't arrive, and the cube shows a smaller number than the source. A destination code that doesn't exist behaves the same way.
A blank source cell with no <blank> rule (or, on a directly matched column,
no <blank> item) is skipped too, and the report names it as <blank> so you
can tell it apart from a mistyped code. Every list of source values in the
product uses that same word for a blank cell.
So the habit that matters: Preview the Link before you run it. The preview reports how many source rows would be skipped, and a surprising skip count is how a missing or mistyped rule announces itself. Once the values are in the cube, the only clue is a total that looks slightly wrong.
A run normally carries that warning forward too: an amber unmatched report naming the codes no rule covered. Where the gap is deliberate — a source whose scope is wider than this cube, so most of its codes are meant to fall away — the Mapping step's Missing items: Ignore switch drops that report, and the run stops nagging. It changes nothing about the transfer: those rows are still skipped, and the skipped count still shows. Only the per-code detail goes away, and only on runs — the editor's preview keeps the full diagnostic on purpose, since that is where you decide whether ignoring them is right.

Using one
Mapping tables live in the Data section, alongside your files and tables. Create one, set its source and destination dimensions (optional, but worth doing — XCubes then warns you about destination codes that don't exist), and fill in the rules. Auto-map can propose matches from the item codes and descriptions on both sides, which you then review.
The source side does not have to be a dimension. Point it at a column of a data table instead — the table, the sheet, then the column — or at a column of an Excel or CSV file in the project's Files area, the same file a Link reads, and the editor lists that column's distinct values with the number of rows behind each. That is usually the better source: it is what the file actually contains, rather than the codes you hope it contains, so a value with no rule is visible as an unmapped entry instead of turning up later as a skipped row.
In the Link editor, each source column can either match codes directly or go through a mapping table — you pick the table per column. One crosswalk can serve every Link that reads the same source system.
See Populating cubes — Links & integrations for the transfer itself, and Dimensions for where the destination item codes come from. For the end-to-end method — reconciling a ledger export into statements that tie line-by-line on the first run — see Build financial statements from a ledger export.