cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Using Repeater on Tag Query History When Passing in Tag Name

Former Member
0 Likes
219

I'm using a repeater on a SQL query that returns a list of tags that I need to check the history for using a tag query. I pass the tag name from the first repeater into the tag query and return the last x amount of minutes of history for the given tag. When I do a repeater on the tag history, the name of the column that returns the value is the name of the tag that was passed in. How do I get the tag values if the column name keeps changing?

Ex. Repeater1.Output{/Row/*tag name*}

The *tag name* part keeps changing and I can't get the results that I want for all tags that I need the history for.

Please help. Thanks.

Eric

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Eric,

have you tried to use a "dynamic link"?

[SAP Help on MII Expression Editor|http://help.sap.com/saphelp_xmii120/helpdata/en/45/b89adfaf1447f7e10000000a114a6b/content.htm]

This way you can build your XPATH expression using variables. Example: say the Tag name is stored in the variable "YourVariable". Using the "#" sign around the variable, MII evaluates the variable value before evaluating the XPATH:

Repeater1.Output{/Row/#YourVariable#}

Michael

agentry_src
Active Contributor
0 Likes

Eric,

Definitely use the dynamic expression as Mike suggests.

One other issue to be aware of. MII (actually I think it is xml) does not like tag names which begin with numbers. Unfortunately there are many data historian tags which have numbers as the first character. Here is a fix for that situation which you may run into:

[xPath|]

Good luck,

Mike

Former Member
0 Likes

I've tried using the dynamic links without any luck. However, the XPath link that you posted led me to find that if I use Repeater1.Output{/Row/*[2]} than it works just fine. Thank you for your help!

Answers (0)