on 11-20-2008 5:17 PM
I have an BLS routine where I need to find the largest numeric value in my XML document. It could be in any row or column. I'm not sure what column it will be in, so the aggregate function is not a good choice (unless I recursively call it for each column and then dynamically assign it to the output) I'm thinking of a couple techniques but I wanted to get some other's opinions first. In the past for things like this I've just nested a couple repeaters but maybe there is a more efficient way.
This is a standard Illumdoc XML format.
Consider a Simulator History TagQuery with L1Speed, L2Speed, L3Speed, L4Speed
Do a CalculatedColumns action block on it adding a column called MaxNumber with an expression like:
max((max((max(L1Speed, L2Speed)), L3Speed)), L4Speed)
Then use the Aggregate Stats block on the Calc Column and get your value.
If the columns are not known in advance you should be able to loop through the Rowsets/Column section for any of the SQLDataType numerical columns and build a similar string as above, assigning it to a local property. You should then be able to use something like #Local.MaxFormula# in the configure dialog of the calculated column.
Regards,
Jeremy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Doug,
I would use xPath or the Aggregate Statistics action block or a combination of both. Do you have a representative sample of xml that you could post?
Thanks,
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.