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.

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_id | name | unit | line |
|---|---|---|---|
| T101 | Zone 1 temp | °C | Oven A |
| T104 | Zone 4 temp | °C | Oven A |
| T131 | Belt speed | m/min | Oven A |
| T152 | Exhaust fan | % | Oven A |
| timestamp | T101 | T104 | T131 | T152 | … 372 more |
|---|---|---|---|---|---|
| 2026-10-12 13:00 | 182.4 | 219.1 | 12.1 | 43.0 | … |
| 2026-10-12 13:01 | 182.6 | 219.4 | 12.1 | 42.6 | … |
| 2026-10-12 13:02 | 182.3 | 219.0 | 12.0 | 42.9 | … |
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:
“Which zone ran hottest on Tuesday afternoon?”
- 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
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.
- Lookup filetag_id, name, unit, line
- Wide filetimestamp + 376 tag columns
- Detected as a pairLookup values = wide column names
- Long tabletimestamp, tag, name, unit, value
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:
| timestamp | tag_id | name | unit | value |
|---|---|---|---|---|
| 2026-10-12 13:00 | T101 | Zone 1 temp | °C | 182.4 |
| 2026-10-12 13:00 | T104 | Zone 4 temp | °C | 219.1 |
| 2026-10-12 13:00 | T131 | Belt speed | m/min | 12.1 |
| 2026-10-12 13:00 | T152 | Exhaust fan | % | 43.0 |
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.

Check the unpack before you trust it
Whatever tool does the unpacking, run these checks the first time.
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.
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.
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.
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
- Unpivot columns (Power Query) · Microsoft Support · checked November 9, 2026