# Best way to make an Expression Tag point to one tag or another dinamically

**URL:** <https://forum.inductiveautomation.com/t/best-way-to-make-an-expression-tag-point-to-one-tag-or-another-dinamically/19428>\
**Category:** Ignition\
**Created:** [August 28, 2018, 2:45pm UTC](https://forum.inductiveautomation.com/t/best-way-to-make-an-expression-tag-point-to-one-tag-or-another-dinamically/19428 "2018-08-28T14:45:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![javier.arena1](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@javier.arena1](https://forum.inductiveautomation.com/u/javier.arena1)\
**Post date:** [August 28, 2018, 2:45pm UTC](https://forum.inductiveautomation.com/t/best-way-to-make-an-expression-tag-point-to-one-tag-or-another-dinamically/19428/1 "2018-08-28T14:45:34Z")

</div>

Hi,

We have 2 versions of the same thing working OK. Which one do you think will perform best? We'll have 1000 tags with the same logic executing on a single gateway.

1. Using the tag() function and building the relative tagpath dynamically, based on another tag's value

> tag(concat("[.]../PM", numberFormat({[.]SELECTOR}, "000"), "/VALUE"))

1. Using the case() function and pointing to the corresponding tag (with {}), based on another tag's value.

> case({[.]SELECTOR},  
> 1, {[.]../PM001/VALUE},  
> 2, {[.]../PM002/VALUE},  
> 3, {[.]../PM003/VALUE},  
> 0  
> )

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 28, 2018, 3:34pm UTC](https://forum.inductiveautomation.com/t/best-way-to-make-an-expression-tag-point-to-one-tag-or-another-dinamically/19428/2 "2018-08-28T15:34:58Z")

</div>

Neither. Use an intermediate custom string property with an expression like:

```auto
numberFormat({[.]SELECTOR}, "000")

```

Then, on the target property, use indirect tag binding with an base expression like so:

```auto
[.]../PM{1}/VALUE

```

and the indirect {1} pointing to the custom string property.  
You should never use the tag() expression function (it is for backwards compatibility). The case() expression would work, but I believe it evaluates all of its expressions, whether used or not. That can result in extra tag value traffic.

**UPDATE** : I just realized you want to do this with an expression tag. If you must, use your form #1. Or even better, don’t make expression tags. Just build the logic I’ve shown into your client app.
