Jump to content
We've recently updated our Privacy Statement, available here ×

Is it possible to do division between 2 variables with different reset types?


justin.watts

Recommended Posts

I am trying to do division between a group count and a report count, but the calculations are not coming out correct.  Here are my variable:

 

DiscIncCount - doing a simple count calculation and resetting by group

TotalDiscIncCount - doing a simple count calculation and resetting by report

DiscIncPercent - $V{DiscIncCount}.divide($V{TotalDiscIncCount},2,RoundingMode.HALF_UP) - the calculations for this variable is not coming out correctly.  For example, if I have 4 for one of the group totals and 640 for the report total (4/640), it should come out to .63, but it is coming out to .01.

All of these variable are set to BigDecimal class.

 

 

 

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Still having an issue with this.  If I have a group total of 2 (which would be 2/662), I get 0.01 for one group.  However, in another group I have total of 2 and it come out to 0.14. I have the calculating variable set the evaluation time of the group.  Is there something I should be using besides Rounding.Mode.HALF_UP?  The calculations vary from group to group. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...