# Calculate Span on Linear Scale Object using View Parameter

**URL:** <https://forum.inductiveautomation.com/t/calculate-span-on-linear-scale-object-using-view-parameter/65021>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [October 10, 2022, 6:02pm UTC](https://forum.inductiveautomation.com/t/calculate-span-on-linear-scale-object-using-view-parameter/65021 "2022-10-10T18:02:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ftuquabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ftuquabo/32/29161_2.png) [@ftuquabo](https://forum.inductiveautomation.com/u/ftuquabo)\
**Post date:** [October 10, 2022, 6:02pm UTC](https://forum.inductiveautomation.com/t/calculate-span-on-linear-scale-object-using-view-parameter/65021/1 "2022-10-10T18:02:01Z")

</div>

I am attempting to calculate the span value using a defined view parameter labeled "MAX\_EU". Basically whenever the min and max values are defined for each variation of the view template, I want the linear scale's span to be automatically calculated based off the max value that was defined for the template view variant. I attempted to use this expression: {view.params.MAX\_EU}/{5}, but getting the message "Error\_ExpressionEval". Can someone tell me if this is actually possible or if there's an issue with the expression.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 10, 2022, 6:04pm UTC](https://forum.inductiveautomation.com/t/calculate-span-on-linear-scale-object-using-view-parameter/65021/2 "2022-10-10T18:04:16Z")

</div>

Are you trying to divide by 5 or is there some parameter you have that is named `5` (which I am not sure is valid).

I think you may want ` {view.params.MAX_EU}/5`

---

<div class="post-metadata">

**Author:** ![ftuquabo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ftuquabo/32/29161_2.png) [@ftuquabo](https://forum.inductiveautomation.com/u/ftuquabo)\
**Post date:** [October 10, 2022, 6:23pm UTC](https://forum.inductiveautomation.com/t/calculate-span-on-linear-scale-object-using-view-parameter/65021/3 "2022-10-10T18:23:26Z")

</div>

Thanks for your response! I tried that expression and that didn't work. The message stated the expression could not write a value to a number. I ended up creating another view param for span and will just manually insert the value for now.
