Skip to main content
6-Contributor
November 26, 2021
Solved

JSON does not allow non-finite numbers for infotable creation

  • November 26, 2021
  • 2 replies
  • 6246 views

Hey guys!

 

I'm working on creating a chart bar for a series of boolean tags that identify errors from a process.

In this case, the chart bar shows the total of times an error appears during an specific period of time. What I did for this was creating two services, the first one adds a "1" for each error into a stream everytime its value it's "true" and the second service does the addition of each 1 for every error in the stream to create an infotable that allows me to put these results into the chart. 

However, this testing was made with 5 errors, but the real process has 511 and when trying to test this, I get a "JSON does not allow non-finite numbers" error when executing the service. I really think the service created may be inneficient for the amount of tags there are, so I was wondering what would you suggest for creating the services to allow me to see these 511 errors in the bar chart? or maybe your suggestions to see this amount of tags as bar charts.

 

Thanks for your help!

 

P.S. I'm attaching the two services I created in .txt

 

The above table is what I'm trying to get:

hjimene3_1-1637948599786.png

 

 

Best answer by VladimirN

A question with a description of a similar error was previously - "Totaling valuestream - JSON does not allow non-finite numbers problem": https://community.ptc.com/t5/ThingWorx-Developers/Totaling-valuestream-JSON-does-not-allow-non-finite-numbers/td-p/584993

 

Also some helpful articles:

2 replies

VladimirN24-Ruby IIIAnswer
24-Ruby III
November 27, 2021

A question with a description of a similar error was previously - "Totaling valuestream - JSON does not allow non-finite numbers problem": https://community.ptc.com/t5/ThingWorx-Developers/Totaling-valuestream-JSON-does-not-allow-non-finite-numbers/td-p/584993

 

Also some helpful articles:

17-Peridot
November 30, 2021

what is the data shape fields of "StreamNumerico" stream? Usually this issue occurs while trying to insert (1/0 = infinity or any string = NaN) kind of numbers.

hjimene36-ContributorAuthor
6-Contributor
December 3, 2021

Hi @Sathishkumar_C , thanks for the feedback. Precisely, there were some NaN values I wasn't aware of. I'm marking @VladimirN as accepted solution since he gave the first answer.

 

Thanks to both of you!

24-Ruby III
December 3, 2021

You're welcome.