Forum Discussion

vpidala's avatar
vpidala
New Contributor II
7 months ago

Value was either too large or too small for a Decimal.

Dear Team, while opening the cube view, I am experiencing issue " Value was either too large or too small for a Decimal." 

I can see that in BR for EndBal, one of the divided formula causing the issue I am thinking. I am trying to add the divide function, but it is not working. any suggestions on the new formula? 

Existing furmula:

Return api.Data.GetDataCell("VariancePercent(A#AVG_Daily_Sales:T#POV:U8#None,A#AVG_Daily_Sales:T#POVPrior12:S#Actual:U8#None)/100")

 

New furmula:

Return api.Data.GetDataCell("(VariancePercent(Divide(A#AVG_Daily_Sales:T#POV:U8#None,A#AVG_Daily_Sales:T#POVPrior12:S#Actual:U8#None)),100)")

 

 

  • aformenti's avatar
    aformenti
    Contributor II

    HI vpidala,

    Why you trying to divide by 100 the result of the Variance Percent Formula? It shouldn't be needed, as it is handled by the predefined function. Have you tried removing it?

    • vpidala's avatar
      vpidala
      New Contributor II

      Thank you Aformenti for quick reply. it is existing formula, it been there for last few years. I removed the divided by 100, still the same issue. how to predefine the dividing? 

      Actually, I am guessing that the error is because of this formula. can you please suggest how to back track to find out the exact interaction or calculation that causing this issue.

      • aformenti's avatar
        aformenti
        Contributor II

        I am not following. 

        The syntax on the new Formula you sent is wrong, you do not need the Divide Function there. Your original formula looks correct:

        api.Data.GetDataCell("VariancePercent(A#AVG_Daily_Sales:T#POV:U8#None,A#AVG_Daily_Sales:T#POVPrior12:S#Actual:U8#None)/100")

        This is wrong:

        api.Data.GetDataCell("(VariancePercent(Divide(A#AVG_Daily_Sales:T#POV:U8#None,A#AVG_Daily_Sales:T#POVPrior12:S#Actual:U8#None)),100)")

        The issue you having must be somewhere else, unfortunately without more info its difficult to assess.