# Any help or insight on how this might have been done?

**URL:** <https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 19, 2024, 4:48pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108 "2024-06-19T16:48:22Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 3:23pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/21 "2024-07-03T15:23:49Z")

</div>

Assuming that this is what you meant:  
Here is the tag's timestamp dataset, which correlates at each row to another dataset which shows its value at that time.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6e99c756cac17d415a7d4ede58b88b2c11c04dd7.png)  
Here is the Value dataset.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/0/c0ddf06212d0f0793a8dd940e47d4520fc868cb3.png)  
So the value at "Line6[0,1]" is the value it held at the timestamp seen at "Line6[0,0]"

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 3:51pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/22 "2024-07-03T15:51:15Z")

</div>

There is however a Different tag which records the same data, but instead of storing it in a big dataset like this, It just shows what the Current value is, so if needed something like that could also be used by enabling history on it and then pulling from that with a component.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 3, 2024, 3:53pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/23 "2024-07-03T15:53:29Z")

</div>

You'd already be done if you just made the expression BOOL tag and enabled the history on it, like I said.

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 3:57pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/25 "2024-07-03T15:57:23Z")

</div>

Okay so about that, I tried that yesterday and got stuck almost immediately. Keep in mind that any suggestions are falling on the ears and eyes of an idiot over here so sorry. But I can't seem to find a way to reference to my setpoint which is a bit of a hangup. The problem being that currently, the setpoints are calculated and held in Custom values of a perspective view for that line, where in those custom values already reference a tag. So if you know a way I can reference those view specific custom values I believe I could do it.

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 3:58pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/26 "2024-07-03T15:58:59Z")

</div>

But without being able to reference those custom values in some way that is a bit of a dead end. The setpoints are not static, and actually change about every 20-45 minutes or so.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 3, 2024, 4:10pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/27 "2024-07-03T16:10:07Z")

</div>

Can you not replicate the calculation in a tag?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 3, 2024, 4:14pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/28 "2024-07-03T16:14:13Z")

</div>

> [@D\_Mitri\_Tompkins](#):
>
> the setpoints are calculated and held in Custom values of a perspective view for that line, where in those custom values already reference a tag.

If I understood the whole thing more or less correctly, views are not supposed to hold this kind of data.  
I suggest you take a step back and tell us about the bigger picture, it seems to me there's something smelly in the way things were done.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 3, 2024, 4:20pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/29 "2024-07-03T16:20:54Z")

</div>

Ok, with that in mind, without creating a new tag and based on the screenshot of the chart that OP has been able to create, even though it wasn't what they were looking for we might be able to work with it.

@D_Mitri_Tompkins can you create two series within the same chart and use a script transform on the flow to transform each to a 0/1 and 1/0 series.

Something like:

series 1:

```python
if dataPoint <= flowSP:
	1
else:
	0

```

series 2:

```python
if dataPoint <= flowSP:
	0
else:
	1

```

both of the series would still bind to the entire dataset

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 4:21pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/30 "2024-07-03T16:21:49Z")

</div>

I'm sure I could, just don't know how to go about that? Would I make a reference tag and then transfer the custom values transform script to that reference tag's "value changed" script?

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 4:26pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/31 "2024-07-03T16:26:36Z")

</div>

Something like this?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e81b90057b54c65914063409b311fad350d345e3.png)  
Where I would bind the same Tag to Both of those data values, then put a script transform on each binding with the above?

And if so what kind of binding do I want to use? Tag (indirect or direct) tag history, or a different one?

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 3, 2024, 4:30pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/32 "2024-07-03T16:30:46Z")

</div>

How did you make this chart?

> [@D\_Mitri\_Tompkins](#):
>
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/f/ff548f46dd541b21c5e02a0e6635720ed92697a6.png)

The tag should likely be indirectly bound to a custom property on the view. Then you can reference that custom property throughout the view.

Export the relevant tag structure for us

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 6:01pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/33 "2024-07-03T18:01:14Z")

</div>

This is where I am at, feels just shy of working.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/0/60ced3abb81ceb806b7ddcbe49721e904b474ca7.png)  
And this is what the chart looks like with those bindings on the data (The ones which will check for above or below setpoint)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/b/9bd159bdfee84ccddf0817b9659714e49f8e3823.png)

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 6:04pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/34 "2024-07-03T18:04:57Z")

</div>

And then if I remove those bindings, the chart is clearly capable of functioning as it changes to look like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/ef9b58530e55e16c42d8c2a3d82518993581e514.png)  
So this is Almost what I need, but there is some clear issues;  
1: without that binding working, which though it correctly yields either a 1 or 0, I can't get this to actually show what I want.  
2: even when it is working close to correctly such as above, it doesn't even work right? Nowhere in the entire object details do I have that light blue color selected, so not sure why that is showing.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [July 3, 2024, 6:26pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/35 "2024-07-03T18:26:21Z")

</div>

What component is this?

Can you please give me your tag structure?

Did this dataset already exist? How is it populated?

> [@D\_Mitri\_Tompkins](#):
>
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6e99c756cac17d415a7d4ede58b88b2c11c04dd7.png)

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 3, 2024, 6:30pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/36 "2024-07-03T18:30:34Z")

</div>

So maybe I overlooked this, but if the original developer already had a chart created and working, why are you not able to copy/paste it and point it to the new line?

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 6:32pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/37 "2024-07-03T18:32:48Z")

</div>

I do not know, I genuinely have no clue. The original chart is on a different view and bringing it into this view immediately broke it. I suspected it was because it referenced a lot of custom values of the page it was on, so I recreated all of those. No dice. Tried building my new chart on the old view just to check, again, no good.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 3, 2024, 6:33pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/38 "2024-07-03T18:33:51Z")

</div>

Are there any scripts you're missing? Custom methods?

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 6:37pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/39 "2024-07-03T18:37:12Z")

</div>

Almost definitely. currently the one that is working on the other view uses an incredibly complicated transform script, I can send it over if you'd like. But it references things that are specific to That data, like stuff that could not exist for my data.

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 6:40pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/40 "2024-07-03T18:40:08Z")

</div>

To hopefully elaborate, this is the current script on the working component:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/7/97c1e5aad0eaf2f42d064db0c95eb90a4897ceb4.png)  
Changing the referenced tags on this tag history binding to the tag I want to display breaks the chart. Doing that and removing this script breaks the chart. Just removing this script breaks the chart.

---

<div class="post-metadata">

**Author:** ![D\_Mitri\_Tompkins](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@D\_Mitri\_Tompkins](https://forum.inductiveautomation.com/u/D_Mitri_Tompkins)\
**Post date:** [July 3, 2024, 6:42pm UTC](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108/41 "2024-07-03T18:42:04Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/0/106c1b936c096bc0349dccd91102be474708def2.png)  
This is the working chart (Above)  
And below is a copy of it where all I have done is bound its dataset to my tag I want to display, and removing the tranform script.

[Previous page](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108.md?page=1)

[Next page](https://forum.inductiveautomation.com/t/any-help-or-insight-on-how-this-might-have-been-done/92108.md?page=3)
