Skip to main content
Known Participant
October 25, 2022
Answered

Percentage calculation from dropdown list

  • October 25, 2022
  • 1 reply
  • 1937 views

Hi,

I have 3 dropdown lists and one overall score.

Dropdown (score): (1=poor,2=good,3=very good, 4=excellent) 

How can I calculate percentage from dropdown score?

screenshot attached

 

If Dropdown 1 = 4, dropdown 2 = 4, dropdown 3 = 4. I get overall score 100%.

 

This topic has been closed for replies.
Correct answer Nesa Nurani

Is your text field formatted as percentage?

What is the value of dropdown fields 1 or 'poor', or is one of them an export value?

If your field is formatted as percentage and let's say dropdown field doesn't have an export value and other values are 1,2,3,4, use this as custom calculation script of percentage field:

var per = 0;
for(var i=1; i<=3; i++){
per += Number(this.getField("Dropdown"+i).value);}
event.value = per/12;

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
October 25, 2022

Is your text field formatted as percentage?

What is the value of dropdown fields 1 or 'poor', or is one of them an export value?

If your field is formatted as percentage and let's say dropdown field doesn't have an export value and other values are 1,2,3,4, use this as custom calculation script of percentage field:

var per = 0;
for(var i=1; i<=3; i++){
per += Number(this.getField("Dropdown"+i).value);}
event.value = per/12;

Known Participant
October 26, 2022

Is your text field formatted as percentage?

Yes

What is the value of dropdown fields 1 or 'poor', or is one of them an export value?

the value is 1,2,3,4

Known Participant
October 26, 2022

I will try the script. Thank you very much