# Report builder keychain expression on versino key property of table group

**URL:** <https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061>\
**Category:** Ignition\
**Tags:** reporting, ignition81, perspective\
**Created:** [April 14, 2026, 1:08pm UTC](https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061 "2026-04-14T13:08:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![William\_Gibson](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@William\_Gibson](https://forum.inductiveautomation.com/u/William_Gibson)\
**Post date:** [April 14, 2026, 1:08pm UTC](https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061/1 "2026-04-14T13:08:15Z")

</div>

Hello,

I have a table group with a “plcid” value coming from the BatchPhases query. I am trying to reference this plcid to change the row version of the Header and Details portions in my table group. plcid can be an int 1-10. I have setup row versions 1-10 as well.

I have tried the following keychain expressions to no luck

Query

> select phasenumber, phasename, starttime as "start", endtime as "end", CONCAT('phase',phasenumber) as plcid from dbo.BatchPhases where steplogid = ?

Expression:

> plcid=="phase1"?"phase1":"Standard"

Query:

> select phasenumber, phasename, starttime as "start", endtime as "end", phasenumber as plcid from dbo.BatchPhases where steplogid = ?

Expression:

> BatchPhases.plcid==1?1:Standard

I have tried the above with various strings and "@" notation as well.  
Below are images to provide some context. Any help is appreciated.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/a/eafc6470acfdac8bbc8fbe8923f5c98d3f692778.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/3/038f835d9d9865264675bc4325d348ccae425528.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/b/9bf43b575184a596c36bb8f243ea01460e0660d0.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/23ed22822620da6762ef490e2de97cfc4f583e48.png)

---

<div class="post-metadata">

**Author:** ![William\_Gibson](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@William\_Gibson](https://forum.inductiveautomation.com/u/William_Gibson)\
**Post date:** [April 14, 2026, 4:11pm UTC](https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061/2 "2026-04-14T16:11:55Z")

</div>

Solved. I used a long keychain expression for each row version, then did NOT uise a dynamic data key. I used the keychain expression as a static key for each row version.

plcid==1?1:plcid==2?2:plcid==3?3:plcid==4?4:plcid==5?5:plcid==6?6:plcid==7?7:plcid==8?8:plcid==9?9:plcid==10?10:Standard

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 14, 2026, 5:05pm UTC](https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061/3 "2026-04-14T17:05:09Z")

</div>

I would move this logic to either the query or add it to the result dataset afterwards with a scripting source.

```python
select if(plcid between 1 and 10, plcid, "Standard") as row_version

```

If you can't add it to the query for some reason, loop over the query results and add the column. It would be easier to find, edit, debug, etc. than that long key chain.

```python

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 14, 2026, 5:11pm UTC](https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061/4 "2026-04-14T17:11:35Z")

</div>

I think what you wanted to do is just `plcid` as the "Version Key" property.

Then add each value to your table as a custom version key.

---

<div class="post-metadata">

**Author:** ![William\_Gibson](https://avatars.discourse-cdn.com/v4/letter/w/a88e4f/32.png) [@William\_Gibson](https://forum.inductiveautomation.com/u/William_Gibson)\
**Post date:** [April 14, 2026, 5:15pm UTC](https://forum.inductiveautomation.com/t/report-builder-keychain-expression-on-versino-key-property-of-table-group/115061/5 "2026-04-14T17:15:42Z")

</div>

This most likely would have worked as well. The real issue is that I was using "dynamic data key" instead of "static data key". Once static was used, things went a lot smoother. Thanks for the reccomendations
