Xtraction Error: System.OverflowException: Value was either too large or too small for a Decimal.

Document ID : KB000004694
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

When creating a Calculated Series in Xtraction for Time Component, Group Component, etc, the system could show the following message:

 

"System.OverflowException: Value was either too large or too small for a Decimal"

 

In addition, at Xtraction logs, you could see messages similar to below:

 

Machine User Id : NT AUTHORITY\NETWORK SERVICE

System.OverflowException: Value was either too large or too small for a Decimal.

   at System.Decimal..ctor(Double value)

   at System.Double.System.IConvertible.ToDecimal(IFormatProvider provider)

   at System.Convert.ToDecimal(Object value)

   at 0.j.1(IndexedDataTable , TimeComponent )

   at 0.j.0(IndexedDataTable , TimeComponent )

   at 0.j.0(TimeComponent )

   at 0.j.GetDataXml(TimeComponent component)

   at SqlDataEngine.Services.Components.TimeComponentService.GetDataXml(TimeComponent component)

   at Xtraction.Web.Services.SqlDataEngineWebService.GetTimeComponentData(TimeComponent component)

 

Environment:
Service Desk Manager - ANY VERSIONXtraction - ANY VERSION
Cause:

This kind of error occurs when you try to divide by zero, which can occur when using a Calculated Series.

 

 

Resolution:

You can wrap the expression for the Calculated Series in an IF statement to avoid this occurring, for example instead of:

 

([S2]/[S1])*100) 

 

Use the following to return 0 where the first series (referenced as S1) is 0: 

 

if([S1]=0,100,([S2]/[S1])*100) 

 

Another example:

 

expressao01.png

 

[S2] * 100 / ([S1] + [S2]) 

 

 

In this case you should be considering when ([S1] + [S2]) could result as zero value.

 

 

Additional Information:

Please also review Xtraction community link:

Error :System.OverflowException: Value was either too large or too small for a Decimal.

Other related document:

TEC1451495