Hi, I compute a simple ratio and send it to a wheel, In case of divide by 0 I get an error (ok)... but how can I manage this error and simply get "0"" instead an error.
Merci !
essql
query={string "SELECT \"jobName\" AS JobsOK
FROM \"tr_carbonite_7d\" WHERE \"isDeleted\" = False AND (\"lastAttemptedBackupStatus\" = 'Completed' OR \"lastAttemptedBackupStatus\" = 'CompletedWithWarnings' OR \"lastAttemptedBackupStatus\" = 'Overdue' ) "}
| math "size(JobsOK)"
| var_set name="nbJobsOK"
| essql
query={string "SELECT \"jobName\" AS Jobs
FROM \"tr_carbonite_7d\" WHERE \"isDeleted\" = False "}
| math "size(Jobs)"
| var_set name="nbJobs"
| math {string {var "nbJobsOK"} "/" {var "nbJobs"}}
| var_set "ratio"
| progress shape="wheel" label={formatnumber "0%"}
font={font align="center" color="#FFFFFF" family="Arial, sans-serif" italic=false size=24 underline=false weight="bold"} max="1" barWeight="5"
valueColor={switch {case if={lte 0.3} then="red"} {case if={all {gt 0.3} {lte 0.7}} then="orange"} default="#00BCB2"}