IMD SolutionComputing LibraryShop main store

Troubleshooting

Tag historian query tall format shows shifted data key aliases

Edge computing and IIoT Published 5 min read

Short answer

When a report's tag historian query runs in tall format and a data key shows t_stamp where a tag alias belongs, the query's returned key list is offset against the configured aliases, not the stored data. Compare returned keys to configured tag paths first, then fix the report binding or script an explicit key-to-tag mapping.

On this page
  1. What the shift looks like on the report
  2. Trace the offset at three layers
  3. Isolate the query from the report binding
  4. Script an explicit mapping only after inspection
  5. Verify before deploying
  6. Questions asked

When a report built on a tag historian query in tall format shows t_stamp where your first configured data-key alias belongs, the query's returned key list is offset by one position against your alias list. The stored data is fine; the labels are mapped to the wrong columns. Work the fault from the query output inward: compare returned keys with configured tag paths first, then the report binding, and only then consider a scripted mapping. The symptom has been reported on 7.9.9 and still on 8.1.1 and 8.1.7, so no version number alone clears a build.

What the shift looks like on the report #

The visible symptom is a data key labeled t_stamp where the first configured alias should appear, with subsequent values then paired to the wrong labels. In one variation the last tag path in the list carried the t_stamp alias instead. A shifted report can still look plausible, so do not judge it by appearance: capture the tag paths, the configured aliases, the returned output keys and the value order before changing anything. That baseline separates an alias shift from a wrong tag path, stale data or a binding fault.

  • Column or key labeled t_stamp in an alias position
  • First alias missing on one report, last tag path displaced on another
  • Values present and plausible, labels shifted by one position
  • Same query returning correct data outside the report

Trace the offset at three layers #

Work the comparison in this order and stop at the layer where the mismatch appears:

  1. Query configuration: list the configured tag paths and their data-key aliases, including the tall-format setting.
  2. Query result: dump the returned keys and compare each key, value and timestamp against the tag paths. In tall format the query returns a fixed-column result, and aliases exist precisely to override the column names the report sees, so a returned key that no alias asked for is the fingerprint of this fault.
  3. Report binding: if the query output keys are correct but the display is wrong, the binding or field selection introduces the shift, and the query is innocent.

If the query output already carries the shifted keys, the report is receiving a mismatched result structure. Never rebind on appearance alone; identify which layer moves the offset first. While you are in the data layer, it is worth confirming the values themselves are sane, the same check you would run when a historian trend shows a real value hours off: one known tag, one known value, one known timestamp.

Example: counting keys for three configured tags

Say you configure three tag paths with aliases tank1, tank2 and tank3 and run the query in tall format. The expected result structure is one timestamp key plus one key per tag: 3 + 1 = 4 keys. The query returns 4 keys, so no tag is missing, but the key at position 1 is t_stamp and the key at position 4 is the timestamp value's own column shifted, leaving tank3 without a key. The offset is the difference between expected and observed alias positions: expected alias index for position n is n − 1, observed is n, so offset = 1. The count being right while the order is wrong is what pins this to key mapping rather than a lost tag: 4 returned keys, 4 configured keys, 1 position of displacement.

Isolate the query from the report binding #

Duplicate the report in a non-production environment and keep the tag paths, aliases and tall-format setting identical. Then:

  • Inspect the raw query result before presentation and compare every returned key with its tag path, value and timestamp.
  • If the keys are clean, inspect the report binding and displayed fields separately.
  • Repeat the comparison with a smaller tag list, then restore the full production list; check both the first and the last entries, because the reported displacement moved between the two ends.
  • If you test another software build, rerun the identical query and report and record the build with its output, not a release-family assumption.

Script an explicit mapping only after inspection #

A workaround that blindly drops the first key or rotates all aliases by one position is unsafe. The observed endpoint of the shift varied between reports, so a positional patch that fixes one layout can assign a different tag's value to an alias in another. Map each returned value to the tag path and alias established by the query output itself, treat t_stamp as the timestamp key and never as a tag data key, and derive the mapping from the actual result keys if the structure changes with the configured tag list. Keep a multi-tag test case; a single-tag test cannot expose an off-by-one error. If the report's real problem turns out to be timestamps rather than keys, check the UTC offset path instead, and if rows are missing entirely, a query row limit is a likelier cause than an alias fault.

Verify before deploying #

Run the report with the complete production tag list in the intended format. For every output field, compare the displayed alias and value against the query result and its tag path: t_stamp stays the timestamp, the first and the last tag entries keep their intended labels. Repeat the comparison after any change to the tag list or the software build, and make that comparison the final gate before the report returns to production. If the underlying host is aging and the repair is no longer worth it, this kind of reporting load is a natural fit for a fanless industrial mini PC as the replacement historian host.

Questions asked

Which version fixes the tall-format alias offset?

No version family proves the fix. The first-alias displacement was reported on 7.9.9; on 8.1.1 and 8.1.7 the symptom persisted, with the last tag path in the list displaced instead on 8.1.1. Test the exact query and report on the target build and record the output; never accept a release number as the acceptance test.

How do I confirm t_stamp is displacing a data key alias?

Dump the query's returned keys before report rendering and set them beside your configured tag paths and aliases. If a key position holds t_stamp where an alias belongs, the query output mapping is shifted. If the keys are correct but the display is wrong, the fault is in the report binding or field selection, not the query.

Can I script a workaround that just drops the first key?

Only after inspection proves that exact result shape for every configuration you run. The displaced position moved between reports: the first alias on one installation, the last tag path on another. Build the mapping from the verified result keys and each value's tag path, keep t_stamp identified as the timestamp, and retain a multi-tag test case so a one-item test cannot hide an off-by-one error.

Does the alias shift mean the historian stored the wrong values?

No. It is a presentation-layer mismatch between the query's returned key structure and the alias-to-value mapping the report uses. Confirm a known tag, value and timestamp from the stored data before touching the report, and treat the historian as correct unless a direct query of the tag path shows otherwise.

Keep reading

  • Troubleshooting

    Historian trend empty: PLC tag collection troubleshooting

    A live PLC value proves nothing about what the historian stored. Work one known, changing tag through four boundaries — controller to data server, server to collector, collector to point, point to chart — and with a 2 s update rate, a 1% deadband on a 200 in span and a 24 in/h fill, a 20 min window must show about 4 stored events. Zero events means the collector; four events with a flat chart means the display.

    Edge computing and IIoT

  • Troubleshooting

    Citect Historian 2016 slow retrieval as SQL tables grow

    Retrieval slow in both the Citect Historian Excel tool and a direct SQL query is a response-time problem in the SQL history tables, which grow with every historized row. Lower over-fast storage rates, purge to your retention, reindex, and start the migration to AVEVA Historian, since end of support for Citect Historian has been announced.

    Edge computing and IIoT

  • How-to

    Connecting InTouch HMI tags to Wonderware Historian by version

    The installed InTouch release decides the path: on 2020 R2 or newer, configure the Historian connection inside InTouch and enable its store-and-forward; on earlier releases, let Historian's IDAS collector read the running InTouch application. Verify with one stored value before expanding the tag set.

    Edge computing and IIoT