Solved

Wrong solution from sum(repeatingsection)

  • 6 October 2022
  • 7 replies
  • 27 views

Hi everyone, I have a weird calculation / displaying problem. 

 

I have a repeatingsection with a numberfield calculating a total value per row. So far so good.

Below the repeating section are again two total fields (one for total net and one for total gross).

 

Total net formula (Sumtotalnetto)= ifElse(SUM([Form].[repeatingsection].[LineTotal])<0,SUM([Form].[repeatingsection].[LineTotal])*(-1),SUM([Form].[repeatingsection].[LineTotal])) - to always get a positive value 

 

Total gross formula = [Form].[Sumtotalnetto]+([Form].[Sumtotalnetto]*([Form].[VAT]/100))

 

So now after filling 6 rows of the repeating section, the formcontrol of Total net shows the sum of all line totals but the last two. But for some reason the gross formula is correct, eventhough its calculating based on the Total nets variable.

26692iF8F8821C5B756E2C.png

As the VAT rate is 0 Total net and gross should come to the exact same solution.

 

So it seems like there is no calculation- but a displaying problem, eventhough the two fields (net and gross) are set up exactly the same way with the only difference, that the net field is connected to a sharepoint number column.

 

I am grateful for any help!

 

 

 

 

icon

Best answer by Garrett 10 October 2022, 14:43

View original

7 replies

Userlevel 6
Badge +16

Hi @Jonasmiddeldorf 


 


1. Could you post an export of your form? Pls remove any confidential information before you share the form.


2. Could you share the values which you used or just post a screenshot?


3. Does it happen for a new form (not yet click submit)?


4. Does it happen when the form is viewed after submit? 

Hi @Garrett,


 


Thank you for your answer!


 


1. how can i upload a .json?


2. attached is a pdf with all the values.


3/4. it happens after submitting. So in view and edit mode.


 

Userlevel 6
Badge +16

Zip the Json Form (.zip) then attach it.


 


Seem the Total ( 7,005.6000 ) is the sum of the first 4 items. 

alright, here we go.


 


Yes exactly.

Userlevel 6
Badge +16

hi @Jonasmiddeldorf 


 


Thanks for the Form. 


Its a difficult-to-prove random BUG with the SUM function.


You must lodge the issue with Nintex Support.


 


The calculation is correct prior to the form submission.


However, when the form is displayed, the BUG may appear.


In my case, it counts the first 10 rows (omits the 11th row).


 


Calc 01.pdf result



 


Fortunately there is a workaround: Specify decimal places as Automatic


@Garrett 


Thank you for your support!


 


One more thing:


How does the decimal places - auto behave?


Because due to the companies requirements, there have to be 4 decimal places. So I am afraid this workaround does not work for me, does it?

Userlevel 6
Badge +16

Hi @Jonasmiddeldorf 


 


This may seem like additional work (just slightly) but is required to comply with the company 4 decimal places requirements and to avoid the sum function BUG. 


 


For all inputs and outputs to be displayed to users - Use the 4 decimal places.


Show these fields.


 


For inputs and outputs that is used by SUM function, you will need to use a rule to populate another field (set to automatic decimal places) and use that field for the SUM function.


Hide these fields (after testing and development)


 


In the diagram below, the green outline fields should be hidden (after testing and development)



 


@Jonasmiddeldorf , you should also post you feedback to Nintex Ideas https://ideas.nintex.com/


Refer to this article


https://community.nintex.com/t5/Community-blogs/Welcome-to-Nintex-Ideas/ba-p/226320 

Reply