cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get Aggregate Statistics using an xPath Link for data to work?

Former Member
0 Kudos

I cannot get this to work. I have a TagQuery for which the tagname is a Transaction Property (Transaction.Tagname). I do not configure the Aggregate Statistics action block. Rather I dynamically link the ValueSource to MyTagQuery.Results{Rowsets/Rowset/Row/#Transaction.Tagname#}. I am looking for the Average result for my set of data. But I always end up with 0.

Note: I put a Repeater on the Tag Query data along with the Simple Statistics action block using the same type of dynamic xPath linked to the DataValue: Repeater_0.Output{/Row/#Transaction.Tagname#}. This works just fine and I will use it, but want to understand why the Aggregate won't work as I would expect.

Thanks,

Message was edited by:

Michael Appleby

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Mike,

You probably have to XMLEncodeName(Transaction.Tagname) and store it to a Local property first, then in the xPath of the aggregate stats action would reference the encoded tag name. If there's an invalid XML character in the original tag name then it will be encoded to and underscore.

Hope this helps.

Sam

agentry_src
Active Contributor
0 Kudos

Sam,

I created a Local property XMLEncodeTagName with type xml and assigned the expression xmlencode(Transaction.Tagname) to it. That fails at that assignment step. I change the local property to type string and it gets past that action block with no failure, but then still returns 0 for the Average.

Then I linked Aggregator_0.ValueSource to an expression:

TagQuery.Results{/Rowsets/Rowset/Row/#Local.XMLEncodeTagName#}

The tagname is all alpha and does not have any invalid xml characters, so that shouldn't be causing a problem.

Then I deleted and rebuilt the local property first as string and then mapped it to the configuration xPath and then it worked fine.

Many Thanks!

Mike

0 Kudos

Mike,

Make sure you are using xmlencodename( Transaction.Tagname ) and not xmlencode( Transaction.Tagname ) ... they behave differently....

Sam

agentry_src
Active Contributor
0 Kudos

Sam,

Thanks for the followup. I was indeed using xmlencode instead of xmlencodename.

Mike

Answers (0)