# Perspective working with tags using script

**URL:** <https://forum.inductiveautomation.com/t/perspective-working-with-tags-using-script/87205>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 12, 2024, 6:00pm UTC](https://forum.inductiveautomation.com/t/perspective-working-with-tags-using-script/87205 "2024-03-12T18:00:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 12, 2024, 7:59pm UTC](https://forum.inductiveautomation.com/t/perspective-working-with-tags-using-script/87205/3 "2024-03-12T19:59:42Z")

</div>

For fun, I decided to implement this using the abovementioned module. I split it into two tags for readability but there's nothing stopping you from nesting the expressions into a single monstrosity:

Tag 1, getting the highest tag value of our group (assuming the tags are nicely ordered and 1-indexed):

```auto
max(
	forEach(
		tags(
			forEach(24, stringFormat("[default]path/to/tag_%d", idx()+1))
		),
	it()[1]
	)
)

```

Tag 2, getting the max of Tag 1 over time (see [Tag Max Value no SQL - #2 by pturmel](https://forum.inductiveautomation.com/t/tag-max-value-no-sql/35649/2))

```auto
objectscript("args[0] if state.get('max') is None or args[0]>state.get('max') else state.get('max')\nstate['max']=__retv",
	{[~]Tag_1})[0]

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-working-with-tags-using-script/87205)._
