Step 11

Importing Sales Data

Bring sales figures into your document from the files you are sent: a Nielsen or Circana report, or a download from a retailer's portal. You set the import up once, as a sales data interface, and run it again each time a new file arrives.

What it does

A product's sales data in Spanner is held like a pivot table, by four things (see Sales data and other product data):

PartWhat it is
MeasuresValue sales, unit sales, weighted distribution, rate of sale and so on: the document's own list.
OutletsThe retailers, store groups or markets the figures are for.
Time PeriodTwo lengths of time, Time 1 and Time 2, such as 52 weeks and 12 weeks.
YearFor each length, the latest year and the previous year.

So there are four periods, and this guide writes them as Spanner does in its saved settings: 1L (Time 1, latest), 1P (Time 1, previous), 2L and 2P. In the window they are named in full, such as 52 Weeks Latest Year.

The import reads the file, works out which of its headings are which measure, outlet and period, finds the product each row is about, and writes the figures in. It can also add outlets, add products, store the file's product codes on your products for next time, and copy columns of the file into classifications.

This guide is for Spanner 2.5.1.2 and later. Earlier versions have the same window; where they behave differently, the guide says so.

Before you start

  • The document has the measures the file brings. A file's measure that has no measure in the document is left out. Check the list in the Document Editor: see Measures and Calculated Measures.
  • Time 1 and Time 2 are the file's lengths of time. If the file has 26 weeks and 4 weeks and the document says 52 and 12, change the document first, or use the Change Time link in the import window. These numbers only describe the data: see the top of the Document Editor.
  • The products have a code the file has. Usually the barcode, or the data provider's or retailer's own code kept in the product's Matches. Products the file has and the document hasn't can be added by the import.
  • The file is an .xlsx, .xlsm or .csv file. From 2.5.1.2 it can be open in Excel while you import. Earlier versions can't read a workbook that Excel has open: close it there first.

Outlets don't need to be there beforehand: the import adds the ones it brings, if you let it.

How the file is read

Spanner can read most layouts, as long as two things hold:

  • Products go down the page. Different products are on different rows. One product can take several rows, when outlets or periods also go down the page.
  • At least one of measures, outlets and time is across the page, as headings along a row.

Each of the three is then in one of three places:

WhereExample
RowsHeadings along a row: Value, Value, Units, Units in row 1.
ColumnsHeadings down a column, beside the products: an Outlet column saying Retailer A on some rows and Retailer B on others.
Fixed ValueNot in the file at all: the whole file is for one measure, one outlet or one period, and you say which.

Two of them can share a row. A heading such as Value Year Ago holds a measure and a period, and you then match each heading to both.

A common layout, with made-up figures. Measures are in row 1, time in row 2, the product's code in column A and its name in column B. The file is for one retailer, so the outlet is a fixed value.

ABCDEF
1Product CodeProductValueValueUnitsUnits
252 w/e 05/10/2552 w/e 06/10/2452 w/e 05/10/2552 w/e 06/10/24
35000000000017Brand A Cola 330ml152,300140,10098,40093,200
45000000000024Brand A Diet Cola 330ml88,90091,50057,10060,300

Every row below the heading rows that has a code in the product column is read as a product. Rows above the headings, such as a report's title, are ignored.

Step 1: the file's layout

  1. Choose Interface › New Sales Data Interface and pick the file. The Decode Data Structure tab shows it as it is in Excel, one tab for each sheet along the bottom.
  2. Sheets: tick the sheets to import, beside each sheet's name at the bottom. Untick summary or notes sheets.
  3. Product ID: type the letter of the column with the product codes, such as A. Its codes turn dark red.
  4. Product Name: type the column with the product's name. If the name is in several columns, type them all with spaces between, such as B C D, and they are joined. The names turn navy. They are used to show and match products, and to name any products the import adds.
  5. Measures: choose Rows, Columns or Fixed Value, then type the row number or the column letter, or choose the measure.
  6. Outlets: the same. A fixed outlet can be one of the document's, or a new name you type.
  7. Time: the same. If the length and the year are on two rows, such as 52 w/e in row 3 and This Year in row 4, type both row numbers with a space, 3 4, and Spanner reads them together. A fixed time is one of the four periods.
  8. Click Next. It appears when the product column and all three are set.

As you set them, the rows and columns are tinted: red for measures, green for outlets and blue for time, mixed where two share a row. If the tints aren't on the headings you expect, a number or letter is wrong.

The Change Time link, above the Time box, sets the number of weeks of Time 1 and Time 2 in the document. Change them here if the file's lengths differ from the document's.

The Interface menu with New Sales Data Interface highlighted, and Sales Data Interfaces below it
New Sales Data Interface, on the Interface menu. Saved interfaces are under Sales Data Interfaces, just below it.
The Decode Data Structure tab showing a demo file. Row 1, the measures, is tinted red; row 2, the outlets, green; row 3, the time headings, blue. The product codes in column A are dark red and the names in column B navy. Along the bottom: Product ID A, Product Name B, Measures Rows 1, Outlets Rows 2, Time Rows 3, the Change Time link and Next
A demo file on the first tab. Measures are in row 1, outlets in row 2 and time in row 3, each tinted; the product codes in column A are dark red, and the names in column B navy.
The Change Time box: Time 1 52 Weeks and Time 2 12 Weeks
Change Time: the weeks of Time 1 and Time 2. A Change button appears beside a number you alter.

Step 2: measures, outlets and time

The Match Measures, Outlets & Time tab lists every heading Spanner found, grouped by what it is, with the file's heading on the left and a list beside it for what it is in Spanner.

  • Measures: choose the document's measure for each heading. Leave a heading blank to leave it out.
  • Time: choose the period for each heading, such as 52 Weeks Latest Year.
  • Headings that hold two things, such as a measure and a period, have two lists.

When nothing is matched yet, Spanner guesses: measures by their names, and periods from the weeks and dates in the headings, taking the later of two dates as the latest year. Check every guess. Right-click a list for Delete Match, or Guess Match to guess that one again.

Each group has a Save button. It stores the group's matches in the interface, so next time the same headings are matched for you. Matches are also stored when you import with Import & Save Interface.

Outlets

Each outlet in the file has a list beside it. The mark after it says what will happen:

YouMarkIts figures
Choose one of the document's outletsa pencil and OverwriteGo into that outlet, replacing the figures there for the products imported.
Type a new namea green plus and AddGo into a new outlet of that name, added to the document.
Leave it blanka red hand and IgnoreAre not imported.

The green arrow beside a blank outlet fills in its own name from the file, so it is added. Add All does that for every blank outlet. Clear All empties them all. Two of the file's outlets can't go into one Spanner outlet: choosing an outlet already chosen clears the other.

Don't use underscores in outlet names. Spanner uses _ to separate the parts of a sales code, such as VALUE_OU_1_TY in a label, so an outlet called Retailer_A can't be read back. Use a space or a hyphen.

Import Calculations

Some measures can be worked out from others as the file comes in, rather than being in the file. Add Calculation adds a line: choose the measure to fill on the left, and type its formula on the right using measure codes. Show Measure Codes lists the codes.

MeasureFormula
Average priceVALUE/UNITS
Unit rate of sale, numericUNTROSW * (WTD / NUM)
Value rate of sale, numeric((VALUE/UNITS) * UNTROSW) * (WTD / NUM)

Use full brackets. Each + - * / joins two things: two codes, a code and a number, or a bracket. A-B-C is read as A-(B-C), so write (A-B)-C. The codes in your document may differ from these; take them from Show Measure Codes. The arrows change the order, which matters when one calculation uses another's result. Sales Data Custom Commands has more, including shares of the file's total.

Import Classifications

If the file has columns beside the figures, such as Brand or Pack Size, they are listed here with a list beside each. Choose a classification, or UPC, and the import writes the column into it for every matched product. A blank cell leaves the product's value as it was.

The Match Measures, Outlets and Time tab. Measures: six of the file's measures matched to the document's, such as Wtd Dist to Dist. (wtd). Time: MAT YA and MAT TY matched to 52 Weeks Year Ago and Latest Year, the 12 week headings to 12 Weeks Year Ago and Latest Year, the 26 and 4 week headings left blank. Outlets: Morrisons Group, Sainsbury and Tesco given names and marked Add, the other twelve marked Ignore, with Save, Clear All and Add All below. Import Calculations: PRICE = VALUE/UNITS, VALROSW = PRICE*UNTROSW and VOLPRICE = VALUE/VOLUME
The second tab. Six measures are matched; four of the eight time headings, as the 26 and 4 week figures aren't wanted; and three of the fifteen outlets, each going into a new outlet. The calculations work out price first, as the second one uses it.
The Outlets list: Grocery Multiples and Tesco matched to the document's outlets of the same names, marked Overwrite with a pencil; Asda and Morrisons Group given new names, marked Add with a green plus; the other eleven blank, marked Ignore with a red hand
All three ways: Grocery Multiples and Tesco go into outlets the document has (Overwrite), Asda and Morrisons Group into new ones (Add), and the rest are left out (Ignore).

Step 3: matching products

Click Next. The Match Products tab opens with as many products matched as Spanner could find. It tries each of these in turn, for the products not yet matched:

  1. the product's ID, capital letters or not;
  2. its barcode (UPC) as written;
  3. its barcode with zeros added to the front of both codes to make 14 digits, so the 8, 12, 13 and 14 digit forms of one barcode agree (earlier versions made 13 digits);
  4. the codes stored in the product's Matches;
  5. a barcode found inside the file's code, such as 5000000000017-CASE.

The file's codes can be tidied first, for instance by adding a missing check digit: see Product codes in Sales Data Custom Commands.

Match to Spanner, or Match to Excel

ChooseThe list has a row forUse it when
Match to SpannerEvery product in the document, each with the file's row it gets its figures from. One row of the file can serve several products, such as two products with the same barcode.Your document is the range you care about, and you want figures for each product.
Match to ExcelEvery product in the file, each with the document's product it goes to.The file is the list, for example when you are adding the file's products to a new document.

Unmatched rows are at the top. A link mark shows a matched row.

Matching by hand

  • Choose from a list: on the side still to match, type part of a code or a name in a row's box and click its arrow, to see the products that fit, then click one. In the list, green products aren't matched yet; orange ones (from the file) or red ones (from Spanner) are matched to another row already.
  • Ask for a guess: the ? button lists the products whose names are most like this one.
  • Undo a match: the red cross on the row.

The filters above the list narrow what you see. On the Spanner side: two classifications with a value each, and three buttons for All products, those on the selected planogram (the planogram icon), or those on any planogram in the document (the document icon, there when it has more than one). On the Excel side: choose a measure, outlet and period to show in the Excel Sales column, and a Minimum and Maximum to show only the rows that sell more than the minimum and no more than the maximum. Matching the biggest sellers first is the quickest way to get most of the sales matched. Before 2.5.1.2, Maximum showed the rows above it, and the document icon showed nothing.

Paste Matches

If you have the pairs in Excel already, a column of the file's codes beside a column of your product IDs or barcodes, copy the two columns and click Paste Matches. Spanner works out which column is which, and matches every pair it can. Codes are compared with zeros added to make 14 digits, as above.

Match File

For a lookup that comes as a file, such as a retailer's list of its own codes against barcodes, click Match File and open the workbook. The Match File window shows it as it is:

  1. Choose the Sheet with the pairs.
  2. Import Code Column: the column with the codes as this sales file has them.
  3. Spanner Code Column: the column with a code Spanner knows the product by: its ID, its barcode, or a code in its Matches.
  4. Click Match. It says how many of the unmatched codes it found.

The headings can be on any row, and other columns are ignored. A match file only fills in what is still unmatched: it never changes a match already made, by Spanner or by you.

The copy icon at the top right copies the whole list to the clipboard, to check in Excel.

The Match Products tab in Match to Spanner. Along the top: Match to Spanner, Match to Excel, Paste Matches and Match File, then the filters, with Value, Morrisons and 12 Weeks Latest Year chosen for the Excel Sales column. Each row is a document product, with its Product ID, UPC and Product Name, beside the Excel Product ID, Excel Product Name and Excel Sales of the file's row it is matched to. The unmatched products are at the top. Along the bottom: Update Data, Update Product Matches, Add Unmatched Products, Import and Save Interface, and Import
Match to Spanner. The unmatched products are at the top, two of them just matched by hand, and Excel Sales shows the Morrisons value sales for the latest 12 weeks, as chosen above it.
Matching by hand in Match to Spanner: on the row for Pepsi Max 8x330, pep is typed in the Excel Product Name box and the list below shows the file's products with pep in their names, such as Diet Pepsi 2L, Diet Pepsi 8x330 and Pepsi Max 8x330, some in green and some in orange, with their sales
Matching by hand: pep typed in a row's Excel Product Name box lists the file's products with pep in their names. The green ones aren't matched yet.
The Match Products tab in Match to Excel: each row is a product in the file, with its sales and a tick box when it is unmatched, beside the document's Product ID, UPC and Product Name. On the row for J2O Glitterberry, gl is typed in the Product Name box, and the list shows two Coca-Cola glass bottle products in red and J2O Glitterberry 4 x 275ml in green
Match to Excel: a row for each product in the file. Here gl lists the document's products with gl in their names; the red ones are matched to other rows already. The tick boxes beside the unmatched rows choose which to add as new products.
The Match File window showing a demo match file: column A, Unique ID Code, tinted blue as the Spanner Code Column; column B, Product Name; column C, Match Codes, tinted green as the Import Code Column. At the bottom: Import Code Column C, Spanner Code Column A, Matched: 61 / 100, and the Match button
A match file: the sales file's codes in column C, the products' IDs in column A. Of the 100 codes still unmatched, it finds 61.

Importing

Along the bottom of the Match Products tab are the import's options and its two buttons.

OptionWhat it does
Update DataWrites the file's figures into the matched products and leaves every other product's figures alone. Use it for a normal update, or to import a category in two files, such as Beer then Cider.
Clear Updated ProductsEmpties all the figures of the matched products first, then writes the file's figures, so they keep nothing from before.
Clear All ProductsEmpties every product's figures in the document first, then writes the file's figures.
Update Product MatchesStores each matched product's code from the file in its Matches, so the next import finds it without help. A code that is the product's own ID or barcode isn't stored, as the product is found by those anyway. Leave it ticked, unless the matches are only for this once. Before 2.5.1.2 the codes were stored whether or not it was ticked, IDs and barcodes included.
Add Unmatched ProductsAdds a new product for each row of the file that found no product, named from the Product Name column, with no dimensions yet. Before 2.5.1.2 this only worked with Update Data.

To add only some of the unmatched products, such as those that sell, right-click the words Add Unmatched Products and choose Criteria. Each line has a Sales Code and a Criteria, for example VALUE_*_*_* and >0: products with any value sales. Adding products in Sales Data Custom Commands explains the codes.

In Match to Excel, each unmatched row also has a tick box. Tick rows to add exactly those: when any are ticked, only they are added, whether or not Add Unmatched Products is ticked, and the criteria don't apply to them. Right-click the small box at the top of that column for Add All, Add in Filter, Clear All and Clear from Filter, which tick or clear every row, or the rows the filters show. Before 2.5.1.2 the ticks were ignored, and every unmatched row was added.

The two buttons

  • Import & Save Interface imports and saves the interface, with all its settings and matches, to run again. The first time, it asks for a name. For a saved interface it reads Import & Save Interface Changes, and saves what you changed.
  • Import imports without saving. If you opened a saved interface, it stays as it was.

The whole import is one step to undo: Edit › Undo puts every figure, outlet, match code and added product back as it was.

The bottom of the Match Products tab: Update Data, Update Product Matches ticked, Add Unmatched Products, and the Import and Save Interface and Import buttons
Along the bottom of the Match Products tab: the update option, the two tick boxes and the two buttons.
The Criteria box: Sales Code VALUE_*_*_* and Criteria greater than 0, with a green plus to add a line and a red minus to remove one
The Criteria box: only products with some value sales are added.

Outlets and planograms

Each planogram reads the figures of one outlet, and compares them with a second, its channel (see Outlets). So after an import into a document with planograms, Spanner may open Join Outlets with Planograms, to say which planograms use which outlets:

  • Outlets to Planograms: for each outlet, tick the planograms that use it as their outlet, or as their comparison channel. Select All and Deselect All help.
  • Planograms to Outlets: each planogram with its Selected Outlet and Selected Comparison Channel, and a line to set them on all planograms at once.

Close it without changes if the planograms are right as they are. Its changes undo with the import.

The Join Outlets with Planograms window on its Planograms to Outlets tab: Planogram 1 with Selected Outlet Tesco and Selected Comparison Channel Grocery Multiples, and the Set Selected Outlet On All Planograms to and Set Selected Channel On All Planograms to buttons
Planograms to Outlets: Planogram 1 reads Tesco's figures and compares them with Grocery Multiples. The green tick keeps the choices.

Saving and running again

A saved interface remembers the file and where it is, the sheets, the layout from Step 1, the measure, outlet and time matches, the calculations, the classification columns and the options. It doesn't remember your product matches: those are stored on the products themselves when Update Product Matches is ticked, which is how they are found next time.

Saved interfaces are under Interface › Sales Data Interfaces, each with two choices:

ChooseWhat happens
Load DataRuns the import straight away, without the window: reads the file, matches everything it can, and imports. Products it can't match are left out. If the file isn't where it was, Spanner asks for it.
OpenOpens the window, set up as saved, so you can check the matches and the products before you import.

So for a monthly file: save the new file over the old one, with the same name, and choose Load Data. If a new month brings new products, use Open instead and match them, once.

Headings with dates in them change every month. A saved match for 52 w/e 05/10/25 won't match next month's 52 w/e 02/11/25. Match periods by their words instead, with Time Match commands in the interface, and Load Data keeps working.

Load Data is also an automation command, so an automation can load several files in a row: see Sales data in the automation reference.

Changing a saved interface

Saved interfaces are listed in Tools › Settings, under Sales Data Interfaces. Each has a row:

ColumnHolds
Name, File PathThe interface's name on the menu, and the file it reads.
ID Code, Description CodesThe Product ID and Product Name columns.
Measure Code, Outlet Code, Time CodesWhere each is: a row number, a column letter, or a fixed value.
SheetsAll, Select Sheets (only those listed) or Ignore Sheets (all but those listed).
MatchTo Spanner or to Excel.
Update MatchesUpdate Product Matches.
MatchesThe measure, outlet and time matches: each with its Dimensions, the file's heading (External) and what it is in Spanner.
Custom CommandsExtra instructions, each a Command with Parameter 1 and Parameter 2: see Sales Data Custom Commands.
Classification UpdateThe classification columns: each a Classification and a Column letter.
Update ActionUpdate Only, Clear Matched or Clear All.

The ... buttons open the lists. The arrows change the order on the menu, the red cross deletes an interface, and the green plus adds one.

Sharing: an interface is part of your own settings. To give it to a colleague, save your settings to a file with only Sales Data Interfaces ticked, as Sharing Tables shows. Start its File Path with %userprofile% in place of your own folder, such as %userprofile%\OneDrive - Organisation Name\Data\Category Sales.xlsx, or put %user% in place of your user name, as in the picture above, and it finds the file on each person's computer.

Interface, Sales Data Interfaces, open on a saved interface called Demo, with Open and Load Data
A saved interface, Demo, with its two choices: Open and Load Data.
Sales Data Interfaces in Settings, with one row: Name Demo, File Path starting C:\Users\%user%\, ID Code A, Description Codes B, Measure Code 1, Outlet Code 2, Time Codes 3, Sheets All, Match to Spanner, Update Matches ticked, 12 Matches, 7 Custom Commands, 0 Classification Update, Update Action Update Only, then the arrows, red cross and copy button
The Demo interface in Settings: its file path starts with %user%, and it holds 12 matches and 7 custom commands.

Ask Spanner AI

Spanner AI can do the whole import with you. It looks at the file first and tells you what it found: the products, the measures, the outlets and the periods. It matches them to your document, lists the products it couldn't match, biggest sellers first, and imports when you are happy. It can match the rest from a lookup file, save the import as an interface, and run a saved interface again with a new file. From 2.5.1.2 it then tells you what changed: how many products got figures, the products and outlets it added, and the match codes and classifications it stored.

For example, ask:
  • "Import the sales data in this Circana file into my document."
  • "Which products in the file didn't find a product? Show me the biggest sellers first."
  • "Match the rest using the retailer's code list in Codes.xlsx."
  • "Only add new products that have value sales."
  • "Save it as Category Monthly, so I can run it next month."
  • "Run my Category Monthly interface on this month's file, and tell me about any new products."

Spanner AI runs a saved interface with its own import, not the Load Data command, so it doesn't run whole automations that load sales data: run those from the menu. Everything it imports is one step to undo, as above.

Spanner's AI Chat window while it works on the request import sales data, Tesco and Grocery Multiples, with the demo sales file shared. Each step is listed with its time: reading the guide, the spreadsheet and the document, reading the settings, then Create Sales Data Import Template three times, running Step1_DecodeStructure and Step2_MatchDimensions, then Step3_MatchProducts, then Step3_MatchProducts and Step4_Import
While Spanner AI works: it reads the file and the document first, then runs the import a stage at a time, matching the last products by hand before it imports.
Spanner AI's reply: the sales data for Tesco and Grocery Multiples has been imported, with Tesco and Grocery Multiples set as Planogram 1's outlet and channel; the 52 and 12 week periods mapped; six measures imported directly and seven calculated on import; and 73 of 74 Spanner products matched, 62 automatically by code and 11 by product description, saved to Product Matches, with the one unmatched product named
The reply: the outlets, set on the planogram too; the periods and measures; and the product matches, with the one product the file doesn't have.

Problems

You seeBecause, and what to do
No Next button on the first tabThe Product ID column, or one of Measures, Outlets and Time, isn't set.
The Match Products tab won't openEach of measures, outlets and time needs at least one heading matched, or a fixed value. Match them on the second tab.
A measure isn't in the listIt isn't in the document. Add it in the Document Editor, then open the import again.
Figures in the wrong period, or year ago and latest swappedA time heading is matched to the wrong period. Check the guesses on the second tab.
Figures a thousand times too smallThe file is in thousands. Use Measure Scale.
Many products unmatchedThe codes are written differently. Compare a few: a barcode without its last digit needs Check Digit; a retailer's own codes need a match file, or Paste Matches, once.
Load Data says No Product MatchesNo row of the file found a product. Open the interface, see why, and check the product column.
Load Data says Excel Structure Not MatchedThe file's headings have changed since the interface was saved, often a date. Open it, match the new headings, and save; or use Time Match commands, so dates don't matter.
Load Data asks you to choose outletsThe measures and periods matched, but none of the file's outlets. Tick the ones to import and give each a Spanner outlet.
Old figures are still there for products not in the fileUpdate Data leaves them alone. Use Clear Updated Products or Clear All Products, or Clear Sales Data on the outlet first.
An outlet's name has an underscoreRename it in the Document Editor with a space or a hyphen, as labels and reports can't read it.
An error when you pick the file, in Spanner before 2.5.1.2The workbook is open in Excel. Close it there and try again.

For files with a layout this page doesn't cover, such as weekly figures to add up into 52 weeks, codes that need tidying, or store-level figures to add up into one outlet, see Sales Data Custom Commands, one of the specialist guides.

A file that won't import?

Send us a sample, with the figures changed if you like, and we'll set the interface up with you.

Email us Book a Demo