Author |
Message
|
vergil_sparda |
Posted: Mon Jan 30, 2017 6:08 am Post subject: Sum with Nan Checking in Message Map |
|
|
Newbie
Joined: 01 Nov 2016 Posts: 3
|
I need to check each element in input sequence for NaN
as on picture and then sum all numbers and move to Amount. How can I do it?  |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Jan 30, 2017 6:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Change your input schema to reject anything that is not a number.
Or change your input schema/model to turn any NAN value into a 0. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
vergil_sparda |
Posted: Mon Jan 30, 2017 9:59 pm Post subject: |
|
|
Newbie
Joined: 01 Nov 2016 Posts: 3
|
mqjeff wrote: |
Change your input schema to reject anything that is not a number.
Or change your input schema/model to turn any NAN value into a 0. |
How can I turn any NAN value into a 0 in XML Schema? I googled a lot but did't find anything |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 31, 2017 5:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
vergil_sparda wrote: |
mqjeff wrote: |
Change your input schema to reject anything that is not a number.
Or change your input schema/model to turn any NAN value into a 0. |
How can I turn any NAN value into a 0 in XML Schema? I googled a lot but did't find anything |
As an offhand guess, that timbert will probably confirm that it's completely wrong...
Try configuring a choice, one that has your actual number format, and the second of which creates a constant value full of 0's. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
timber |
Posted: Wed Feb 01, 2017 12:59 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Wouldn't a small piece of custom XPath in the Mapping node do the job? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 01, 2017 4:50 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
timber wrote: |
Wouldn't a small piece of custom XPath in the Mapping node do the job? |
Is it faster to adjust the model to present zeros, such that a basic sum can be performed, rather than having to run a custom xPath for each line?
I don't think either of us knows. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
martinb |
Posted: Fri Feb 03, 2017 5:24 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
|
Back to top |
|
 |
|