# Divide by 0 / wheel in canvas

**URL:** <https://discuss.elastic.co/t/divide-by-0-wheel-in-canvas/369862>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [October 31, 2024, 6:41am UTC](https://discuss.elastic.co/t/divide-by-0-wheel-in-canvas/369862 "2024-10-31T06:41:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfsardon](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jfsardon](https://discuss.elastic.co/u/jfsardon)\
**Post date:** [October 31, 2024, 6:41am UTC](https://discuss.elastic.co/t/divide-by-0-wheel-in-canvas/369862/1 "2024-10-31T06:41:42Z")

</div>

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 !

```auto
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"}

```
