Percentage and Sub Total Calculations

Community Beginner ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

Hi,

I need to create a calculation so that whatever is entered into the 'percentage uplift' box gets added to the 'subtotal own stock' and gives me a total. Do I need a javascript to do this? Should I keep the percentage uplift field a percentage or a number?

 

Hope you can help

 

ThanksScreenshot 2021-03-10 at 16.08.07.png

TOPICS
PDF forms

Views

196

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Mar 12, 2021 Mar 12, 2021
++Adding to the discussion,   I see that you have all the text field object names starting with a number.   I've read in other threads in this community that when you use simplified notation or the built-in "SUM" feature to calculate field values it may throw errors.   What I would do in this caseis to follow the same guidance that George Johnson already gave you but change the field names. In particular just eliminate the "5" that is preceding every field name in your PDF and see if that resolv...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Mar 10, 2021 Mar 10, 2021

Copy link to clipboard

Copied

You don't need to use JavaScript necessarily, unless you have specific rounding requirements. You could use the simplified field notation option when setting up a calculated field, and it would probably be best to set it to a number and configure the calculation correctly. For example, in the Totals field, the what you'd enter could be:

 

5OwnStockSubTotal * (1 + 5PercentageUplift / 100)

 

Assuming that's the correct formula.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Thnak you I think that has worked.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

Ah, I have tested it again and it does not work for some reason.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 11, 2021 Mar 11, 2021

Copy link to clipboard

Copied

If it appears to have worked at times but not others, it could be a problem with the field calculation order. If you're unaware of how to set it correctly, post again and include the version of Acrobat that you're using. Also, include more details about how it's not working.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

Hi there, I originally put your calculation in the 'Plus percentage uplift' box, not the totals field. The calculation adds the number and not a percentage.

 

I need the left totals field to calculate the 'Sub total Own Stock' + 'Plus a percentage uplift' and the right totals field to calculate the figures on the right. The trouble I am having is, what calculation do I put in the 'Plus a percentage uplift' box to add what ever percentage they enter to te 'Sub total - own stock' to give a figure for 'Totals' box on the left.

 

The other issue I am having is that as you can see by the screen shot my calculation for the 'Grand Total Amount Insured' is not picking up the percentage uplift field.  When I add it into the calculation it adds the amount to both totals, not just the one on the left.

 

I am using the latest Acrobat Pro DC software.

 

Many thanks

Screenshot 2021-03-12 at 10.37.50.png

 

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

++Adding to the discussion,

 

I see that you have all the text field object names starting with a number.

 

I've read in other threads in this community that when you use simplified notation or the built-in "SUM" feature to calculate field values it may throw errors.

 

What I would do in this caseis to follow the same guidance that George Johnson already gave you but change the field names. In particular just eliminate the "5" that is preceding every field name in your PDF and see if that resolves the issue.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 12, 2021 Mar 12, 2021

Copy link to clipboard

Copied

Thank you very much. That has made it work now.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines