Platform how-to

Analyzing "lookup table plus one very wide table" exports without unpivoting by hand

Machine historians, survey tools and many ERP reports export one row per timestamp and one column per field, with a second file that says what each column means. Here's how to turn that pair into a table you can ask questions of.

Storek team5 min read

Relationship map on navy: a wide export with hours as columns, a zone lookup and a shift calendar connect on zone, zone code and date plus hour to a hub of one row per oven reading.
Sample dataA wide export turned into one row per reading. Illustration.

You ask the plant’s historian for a week of oven data and get two files. One is short: a list of tag IDs, each with a name, a unit and a line. The other is enormous: one row per minute and one column per tag, labeled T101, T102, all the way to T476.

Survey tools do the same thing with a question list and a column per question. So do many ERP and lab exports. The shape is common enough to have a name, and it is one of the most annoying shapes to analyze.

What the pair looks like

Here is a small slice of each file. The tags, names and readings are invented.

tag_idnameunitline
T101Zone 1 temp°COven A
T104Zone 4 temp°COven A
T131Belt speedm/minOven A
T152Exhaust fan%Oven A
Sample dataThe lookup file: one row per tag, saying what each code means.
timestampT101T104T131T152… 372 more
2026-10-12 13:00182.4219.112.143.0…
2026-10-12 13:01182.6219.412.142.6…
2026-10-12 13:02182.3219.012.042.9…
Sample dataThe wide file: one row per minute, one column per tag. The column names only mean something through the lookup file.

Questions about this data are simple to say and hard to run. “Which zone ran hot on Tuesday afternoon?” needs to know that T104 is Zone 4, that it’s in degrees, and that the other temperature tags are T101 to T106. None of that is in the wide file.

Why unpivoting by hand keeps breaking

The standard fix is to unpivot: turn the wide table into a long one, with one row per timestamp per tag, then join it to the lookup file to get names and units. In Excel’s Power Query, that is Transform, then Unpivot Columns. Written out by hand, that means one block per tag, hundreds of times over, and it breaks the day a tag is added. In Storek it looks like this:

In Storek
You ask

“Which zone ran hottest on Tuesday afternoon?”

What Storek did
  • recognised the lookup file as the dictionary for the wide export
  • turned the hundreds of tag columns into named, labelled readings
  • kept only temperature readings and compared zones hour by hour
The answer

One clear answer by zone and hour, with no reshaping by hand.

Dig deeper: see how it works

Storek spotted that the lookup’s tag IDs are the wide file’s column names, unpacked every column, and attached each tag’s name, unit and line. When the export gains a new tag next month, it is unpacked the same way.

It works once. Then it breaks in quiet ways. Someone adds a tag, and the new column isn’t in your list, so it silently drops out. A blank cell becomes a zero in one step and a null in another. Two tags with different units get averaged together because the names look alike. And every new export means redoing the job, or trusting a spreadsheet step nobody has opened in months.

Unpacking the pair automatically

Storek treats this shape as something to recognize, not something to fix by hand. Field-dictionary detection notices when one table is a dictionary for another: the values in the lookup’s tag_id column are the column names of the wide table. It then unpacks the pair into clean tables, with names and units attached to every reading.

  1. Lookup filetag_id, name, unit, line
  2. Wide filetimestamp + 376 tag columns
  3. Detected as a pairLookup values = wide column names
  4. Long tabletimestamp, tag, name, unit, value
Field-dictionary detection matches the lookup's values to the wide table's column names, then unpacks the pair.

On one validation export shaped this way, the unpacked result had 162,590 rows and matched a reference query exactly. The result looks like this:

timestamptag_idnameunitvalue
2026-10-12 13:00T101Zone 1 temp°C182.4
2026-10-12 13:00T104Zone 4 temp°C219.1
2026-10-12 13:00T131Belt speedm/min12.1
2026-10-12 13:00T152Exhaust fan%43.0
Sample dataThe long table: one row per reading, with the meaning attached.

Now the Tuesday question is an ordinary one. Ask it in plain English, and the answer comes with the SQL that ran against the long table.

Line chart over 24 hours: Zone 4 temperature holds near 210 °C and jumps to about 219 °C from 13:00 to 15:00, while the exhaust fan drops from about 64% to about 42% in the same hours.
Sample dataZone 4 temperature and the exhaust fan over one day. The two tags were columns T104 and T152 in the wide file; the drop in fan speed lines up with the hot spell. Invented data.

Check the unpack before you trust it

Whatever tool does the unpacking, run these checks the first time.

  1. Count the rows

    The long table should have at most one row per timestamp per tag. Count the filled cells in the wide file’s tag columns and compare. Storek also checks every load’s final row count against the source and fails loudly on a mismatch.

  2. Spot-check five readings

    Pick five cells in the wide file, across different tags and times, and find each in the long table. Same value, same tag, same minute.

  3. Look at units per tag

    Each tag should have exactly one unit. A tag that shows two units means the lookup file changed, or two tags share an ID.

  4. Add a tag and watch it arrive

    Next week’s export may have a new column. Storek says when a source gains columns rather than staying quietly green, so you know the new tag is there before someone asks about it.

Sources

  1. Unpivot columns (Power Query) · Microsoft Support · checked November 9, 2026

Data loadingSemantic layerOperations

FAQ

Questions, answered.

What is a wide table?

A table with one column per measure or field instead of one row per measure. A sensor export with a column for every tag, or a survey export with a column for every question, is wide. It's easy for a system to write and hard to analyze, because the column names are often codes and every new field adds a column.

How do I unpivot columns in Excel?

In Excel's Power Query, select the columns and use Transform, then Unpivot Columns. You then merge the result with the lookup table to get readable names. You have to refresh or repeat it when the export changes shape.

What is field-dictionary detection?

Storek recognizes when one file is a dictionary for another, for example when the values in a tag list are the column names of a wide table, and unpacks the pair into clean tables. On one validation export, the unpacked result had 162,590 rows and matched a reference query exactly.

What happens when the export gains a new column?

Storek tells you the source gained columns instead of staying quietly green, and the tiles built on the earlier columns keep working.

Book a demo

See your own data, delivered.

30 minutes. Your data or our sample. No slide deck. Pick a time straight after the form.