Forums
Script to add conditional statements in calculated field - Printable Version

+- Forums (https://bdn.bdb.ai)
+-- Forum: BDB Knowledge Base (https://bdn.bdb.ai/forumdisplay.php?fid=13)
+--- Forum: BDB Dashboards Designer (https://bdn.bdb.ai/forumdisplay.php?fid=43)
+---- Forum: BDB Designer Q & A (https://bdn.bdb.ai/forumdisplay.php?fid=16)
+---- Thread: Script to add conditional statements in calculated field (/showthread.php?tid=398)



Script to add conditional statements in calculated field - Sruthi P - 12-22-2022

How to write conditional statements in calculated field?

Add the script in calculated script area 

‘sdk.calculation.getDivision(Marks)’

Add the below script in connection script area. 

sdk.calculation = sdk.calculation || {}; 
sdk.calculation.getDivision = function(marks){ 
if(marks>=50) 
return 'Pass'; 
else if(marks<50) 
return 'Fail'; 
};