Hello @gazza21,
I’m sorry, I cannot implement your project as support service, if you need the implementation of your equations, please, request a custom coding service through my private website:
https://cff.dwbooster.com/customization
As support service, I can give you some indications and tips.
For example, assuming your form includes two dropdown field: fieldanem1 and fieldname2, where fieldname1 includes the choices: A, B and C, and the fieldname2 the choices: 1 and 2, and you want multiply the fieldname3 that is a number field by a factor depending on the choices selected in the other two fields as described below:
– If A and 1 were selected in the fields fieldname1 and fieldname2 respectively, then, use the factor 0.5
– If A and 2 – Factor: 0.8
– If B and 1 – Factor: 0.3
– If B and 2 – Factor: 1
– If C and 1 – Factor: 0.9
– If C and 2 – Factor: 0.7
Note: The fields’ names, the choices and values are hypothetical, only to describe the process.
The equation corresponding to this hypothetical case might be:
(function(){
var factor = 0;
if(fieldname1 == 'A' && fieldname2 == 1) factor = 0.5;
if(fieldname1 == 'A' && fieldname2 == 2) factor = 0.8;
if(fieldname1 == 'B' && fieldname2 == 1) factor = 0.3;
if(fieldname1 == 'B' && fieldname2 == 2) factor = 1;
if(fieldname1 == 'C' && fieldname2 == 1) factor = 0.9;
if(fieldname1 == 'C' && fieldname2 == 2) factor = 0.7;
return fieldname3*factor;
})()
Another possibility, creating an object with the combinations, and use the fields’ names as the names of the object’s attributes:
(function(){
var db = {
'A':{1:0.5, 2:0.8},
'B':{1:0.3, 2:1},
'C':{1:0.9, 2:0.7}
};
return fieldname3*db[fieldname1][fieldname2];
})()
Best regards.