Copy link to clipboard
Copied
I tried looking at previous examples of this but my javascript is pretty limited so I'm still a little confused. I want to calculate specific fields for a cumulative value of 100%. For example 6 fields at roughly 16.6%. I want to execute this via a drop down menu and have it populated cumulatively as each of the 6 fields is selected...so if only one field is selected, the cumulative value would be only 16.6%, if two fields, then it would be 2x16.6% etc. I attached an image of how each of the six fields would be setup.
Copy link to clipboard
Copied
Don't use JavaScript. Do this instead:
1) Include export values for each of the dropdown entries.
a) 0 for "incomplete"
b) 16.6 for "complete".
c) Don't use "Select", delete it, and make "incomplete" the default.
2) for the result field, use the built-in Sum calculation.
Copy link to clipboard
Copied
Thanks Thom for the quick response; I will give this a try!
Copy link to clipboard
Copied
It worked! I just need to figure out how to make it capture 16.6% and not 1660.0% in the result field but I'll play with the format to straighten it out, Thanks again!
Copy link to clipboard
Copied
Change the export value to 0.166
Copy link to clipboard
Copied
Awesome! Happy New Year!
Copy link to clipboard
Copied
Your question is very confusing. Where does the result go? In a text field? Is it 6 separate dropdowns like the one pictured that feeds the result?
Copy link to clipboard
Copied
Thanks for quick response; so yes, it is 6 seperate dropdowns that feed the result. And the result is a seperate text field under the category "% complete". I want the result text field to accumulatively calculate each one of the dropdowns as they are completed.
Copy link to clipboard
Copied
Use @Thom Parker 's solution. You can leave "Select" if you want but make that 0 export value as well. Also, check "Commit selected value immediately" in the options tab of the dropdowns so the results will appear as soon as a selection is made instead of on a blur event (leaving the field).