The problem is that my tag have to be dynamic. When i try to use script transform and fetch the data through queryTagHistory I can not get the same result.
The startDate and endDate parameters work as it should, but the intervalHours and rangeHours is not responding at all. Is there a bug with this function or am I not understanding this correctly?
You can make a tag history binding use dynamic tags, with the expression. I do remember I had a hard time making it work, but it's possible.
Few comments here:
You're passing startDate, endDate AND rangeHours, and with conflicting values. Your startDate is 7 days before endDate, but rangeHours is set to 24. What are you trying to do, or what did you expect those to do ?
I'm not sure how returnSize=-1 and intervalHours=x play together.
@pascal.fragnoud Do you have an example of how you did make the tag dynamic with expression?
It might be that I am not understanding this correctly, what I am trying to do is exactly the same as in the first picture. Show data from the last 7 days and group the data together by 1 day intervals.
I need to connect the location number and unit number in the tagpath to a parameter['[default]P176/Passengers/Location_{Parameter_1}_Unit_{Parameter_2}/passengers']
@lrose your example is working is this the best way to do this? I tried using expression but I cant figure it out.
I think that the binding without the transform is the correct way to do this. You have to set it up first though. I will assume that you already have properties for Parameter_1 and Parameter_2.
Add a custom prop to the view or coponent that this binding will be on. It must be an Array type.
Add an array element of object type for each tag that you want to collect history for. For this example I’m assuming only 1 tag.
Add three values to each array element they must be named ‘aggregate’, `alias’, and ‘path’.
Set the aggregate to ‘maximum’, and the ‘alias’ to whatever you want, I wet with ‘passengers’, if you leave the alias blank the tag path will be used.
Configure an expression binding on the path with the following expression. Note that the path to your parameters is probably different. Use the property selector to get the correct path.