Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Calculating item codes

New Here ,
May 09, 2016 May 09, 2016

I have a form that I cannot wrap my head around.

adobe_forum_code_calculation.png

In the "Time" section on the left, there are a series of dropdown menus that correlate with the "Activity Codes" in the right column.

I need to calculate how many times a particular code appears in the "Time" section and multiply 30 (minutes) and then get a percentage for that particular activity over the week or 3,300 minutes.

As you can see the calculations for the "01 Face-to-Face Selling" is not correct because the "01" code appears 21 times for a total of 630 minutes.

In "02 Selling on the Phone", I manually typed in the number to show what I need it to do.  The "02" code appears 22 times for a total of 660 minutes.

I also need to make sure that the percentages add up to 100%

Is it possible to calculate this?

TOPICS
Acrobat SDK and JavaScript , Windows
281
Translate
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
LEGEND ,
May 09, 2016 May 09, 2016

Sure it's possible If you provide information on the field names involved, it would be helpful. I'd suggest using just a single calculation script, as opposed to one of each calculated field. It would be responsible for calculating the values for all the fields on the right.

Translate
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
New Here ,
May 09, 2016 May 09, 2016

The field names on the left are labeled like this:

Day1_730, Day2_730, Day3_730, Day4_730, Day5_730

Day1_800, Day2_800, Day3_800, Day4_800, Day5_800

etc.

The "Total Minute" field names are:

AC1

AC2

AC3

etc.

The "% of Time" field names are:

time1

time2

etc.

I am not sure what you mean by a single calculation script (I am a newbie when it come to this) 🙂  Could you provide an example?

Thank you for the quick response!

Translate
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
LEGEND ,
May 10, 2016 May 10, 2016
LATEST

Acrobat forms do not have specific order calculation so it is possible that as you create the form the order in which you want the calculations to occur will be used by the form. So then one either has to manually adjust the order of each calculation or write one script that sums all the activity codes using an array to accumulate each activity and then calculates the minutes for each activity and set the total for each activity.

Translate
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