ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sum with Nan Checking in Message Map

Post new topic  Reply to topic
 Sum with Nan Checking in Message Map « View previous topic :: View next topic » 
Author Message
vergil_sparda
PostPosted: Mon Jan 30, 2017 6:08 am    Post subject: Sum with Nan Checking in Message Map Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Mon Jan 30, 2017 6:25 am    Post subject: Reply with quote

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
View user's profile Send private message
vergil_sparda
PostPosted: Mon Jan 30, 2017 9:59 pm    Post subject: Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Tue Jan 31, 2017 5:46 am    Post subject: Reply with quote

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
View user's profile Send private message
timber
PostPosted: Wed Feb 01, 2017 12:59 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Wouldn't a small piece of custom XPath in the Mapping node do the job?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Feb 01, 2017 4:50 am    Post subject: Reply with quote

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
View user's profile Send private message
martinb
PostPosted: Fri Feb 03, 2017 5:24 am    Post subject: Reply with quote

Master

Joined: 09 Nov 2006
Posts: 210
Location: UK

This can be done with the a Custom XPath expression as answered in developerworks Forum: WebSphere Message Broker post
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Sum with Nan Checking in Message Map
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.