Hello @civilvicky
The equation in this case can be implemented as follows:
SUM(ABS(1-fieldname3),ABS(2-fieldname3),ABS(8-fieldname3))/fieldname2
Best regards.
The formula is not working properly.
For example I used this values.
Fieldname1 : 1,2,8,2,8
fieldname2 : 5
fieldname3 : 4.2
The answer I am getting is:
Fieldname12 : 1.8399999999999999
But this is not correct answer. The correct answer would be:
Average Deviation : (|1-4.2|)+(|2-4.2|)+(|8-4.2|)+(|2-4.2|)+(|8-4.2|) / 5
Average Deviation : (|-3.2|)+(|-2.2|)+(|3.8|)+(|-2.2|)+(|3.8|) / 5
Average Deviation : (3.2)+(2.2)+(3.8)+(2.2)+(3.8) / 5
Average Deviation : 15.2 / 5
Average Deviation : 3.04
The values of the fieldname1 are entered by users. I have used some values just as example. Users can enter any values.
Hello @civilvicky
You are describing a different situation.
The fieldname1 values are multiple numbers separated by commas. So, you must split its components.
In this case, the equation must be implemented as follows:
(function(){
var v = fieldname1|r.replace(/[^\d\.\,]/g, '').replace(/^\,+/, '').replace(/\,+$/, '').replace(/\,+/g,',').split(','), result = 0;
for(var i in v){
result += ABS(v[i]*1-fieldname3);
}
return PREC(result/fieldname2, 2, true);
})()
Best regards.
Thank You So Much. This really helped.