superky
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] If else statement in table in calculation fieldSorry just saw your reply after my reply.
Let me try with your suggestion
Forum: Plugins
In reply to: [Calculated Fields Form] If else statement in table in calculation fieldI managed to get it done by myself with
table += (function(){if(fieldname3>='3' && fieldname4>='3' && fieldname6>='2' && fieldname5>='2') return '<tr><td>'+fieldname31+'</td><td>'+fieldname41+'</td><td>'+fieldname51+'</td><td>'+SUM([fieldname3,fieldname4,fieldname6,fieldname5,fieldname16,fieldname18,fieldname20,fieldname22].sort(function(a, b){return a - b}).reverse().slice(0,5))+'</td><td> 24.5 </td><td> 24.5 </td><td> 23 </td><td> 23 </td></tr>';})();
however, on top of the table, it has a ‘undefined’.
Any suggestion to improve on the code above?Forum: Plugins
In reply to: [Calculated Fields Form] How to get the five highest valueI got one more question.
Now I wanna to expand the equation into below:
still based on the Best 5 principles with the inclusion of
i) must have fieldname3
ii) at least one best subject of fieldname6, and two electives from dropdown fields which the values are MTH1 and MTH2.there are 4 dropdown fields for user to select, they are fieldname15, fieldname17, fieldname19 and fieldname21
Forum: Plugins
In reply to: [Calculated Fields Form] How to get the five highest valueThanks for pointing out, now it is giving the correct values.
Thank you so much
Forum: Plugins
In reply to: [Calculated Fields Form] How to get the five highest valuehttps://13.215.21.237/admissions-calculator/
Could you please have a look on the calculator in frontend?
pop up username: test
pop up password: test1Forum: Plugins
In reply to: [Calculated Fields Form] How to get the five highest valueSorry for the typo, I typed out the values manually.
But this is weird, I exactly copied the equation you provided. Below is the equation I pasted, but it still returns 34 to me.
SUM([fieldname3,fieldname4,fieldname6,fieldname5,fieldname16,fieldname18,fieldname20,fieldname22].sort(function(a, b){return a - b}).reverse().slice(0,5))
Forum: Plugins
In reply to: [Calculated Fields Form] How to get the five highest valueYes, the return should be 42.5.
However, when I inserted the equation you provided earlier: SUM([fieldname3,fieldname4,fieldname6,fieldname5,fieldname16,fieldname18,fieldname20,fieldname22].sort(function(a, b){return a – b}).reverse().slice(0,5));
returns 34 instead 42.5
Forum: Plugins
In reply to: [Calculated Fields Form] How to get the five highest valueDear codepeople,
Thanks for your prompt response and equation.
However the equation provided returns incorrect amount, please see below example:
the values = 8.5, 8.5, 8.5, 8.5 8.5, 3, 3, 2
the return should be 42.5, however the equation provided returns 34.
Thanks.