# Tag Name of Min() Value in Expression Tag

**URL:** <https://forum.inductiveautomation.com/t/tag-name-of-min-value-in-expression-tag/67673>\
**Category:** Ignition\
**Created:** [December 15, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/tag-name-of-min-value-in-expression-tag/67673 "2022-12-15T14:51:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DSandy](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dsandy/32/29409_2.png) [@DSandy](https://forum.inductiveautomation.com/u/DSandy)\
**Post date:** [December 15, 2022, 2:51pm UTC](https://forum.inductiveautomation.com/t/tag-name-of-min-value-in-expression-tag/67673/1 "2022-12-15T14:51:10Z")

</div>

I need to create an expression tag (or two tags) that return the minimum value from a set of related tags, and the tagname of the particular tag that had the minimum value.

Getting the value is easy using min(Tag1, Tag2...Tagx), but I'm struggling with returning the name of the tag that is associated with the minimum value. Or even just the index in the list being used for the evaluation.

I know I'm missing something, maybe even configuring a dataset or something along those lines, welcome any suggestions on how to get there.

---

<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:** [December 15, 2022, 4:22pm UTC](https://forum.inductiveautomation.com/t/tag-name-of-min-value-in-expression-tag/67673/2 "2022-12-15T16:22:17Z")

</div>

I don't think you're missing anything; this is just not something that's easy to do in expressions.

I would use the runScript function and a project library script that accepts `*args` and returns the index of the min. With Python, it's relatively easy to just build a simple function that iterates through the input, collects the minimum value, and returns the index it was found at.
