on 09-26-2013 9:28 PM
Hi,
In 12.2, we have an issue in SUM function in XPATH in transaction. Sum function is working fine for small double values but for large double values has exp it is showing value as NA.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Rowsets DateCreated="2013-09-26T13:36:30" EndDate="2010-12-22T14:31:00" StartDate="2010-12-22T14:31:00" Version="12.1">
<Rowset>
<Columns>
<Column Description="" MaxRange="1" MinRange="0" Name="DoubleCol" SQLDataType="8" SourceColumn="DoubleCol"/>
</Columns>
<Row>
<DoubleCol>2.160445391E7</DoubleCol>
</Row>
<Row>
<DoubleCol>5.460645391E7</DoubleCol>
</Row>
</Rowset>
</Rowsets>
For this XML as input param xmlin and in transaction, if we are using
Transaction.xmlin{sum(/Rowsets/Rowset/Row/DoubleCol)}
it is giving value as NA. But if DoubleCol value is small (like 10000,20000), it is showing sum result.
How to solve this issue.
Regards,
Senthil
Addressing the scientific notation at the source would be the best, but of course depends on how much control you have over the 'xmlin' property for your transaction. If you can't rely on this and use the simple xpath sum, then one option could also be using a calculated column action block to add number(DoubleCol) to the dataset of your xmlin property value. The xpath sum should easily work from that resultset and in case you need to do any other work with the resultset coming into the transaction you always have both the original and the adjusted values for each row.
Regards,
Jeremy
Rapid Innovation Group (RIG)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil,
As suggested by Anuj, the sum function of XPATH does not understand this exponential number format. So, using Aggregate Statistics is a good option here. I tried it and it works fine.
Is there any specific reason to use XPATH? Or else, switching to this would be a good idea.
Regards,
Saumya Govil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil,
XPATH's 'sum' function does not recognize '5.460645391E7' format of number.
You can use 'Aggregate Statistics' action block under XML functions and get the 'Total' from its output, and check if it is giving you correct results.
Hope this helps you!!
Warm Regards,
Anuj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
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.