Zero like result in canvas

I have a question, on Metric, I can have the "0" like result because I have this symbol:
image

and i want to have "0" instead of this symbol.
Could anyone help me ? I can not it solve.

filters
| essql 
  query="SELECT SUM(length) AS sum FROM \"data-*\"
WHERE QUERY ('ptx')
AND status = 4
AND id = 2"
| math "sum"
| metric " " 
  metricFont={font align="center" color="#00a0e3" family="'Open Sans', Helvetica, Arial, sans-serif" italic=false size=60 underline=false weight="bold"} 
  labelFont={font align="center" color="#FFFFFF" family="'Open Sans', Helvetica, Arial, sans-serif" italic=false size=30 underline=false weight="normal"} metricFormat="0,0.[0]"
| render

I guess this happens when there are no results to your query right?
You could add a check for the row count.
If row count is 0 then you show the zero value.

Well this happened because I have changed the dates of my filter, because I do not always have data, so when this happens I would like it to show me zero and not the error, it would be a better presentation. As it is, I should do the check, because I tried to use IF but I think I did something wrong, could you tell me how the check would be?

Replace your math function with the following. That should work

var_set "sum" value={if condition={rowCount | gt 0} then={getCell  column="sum"} else=0}
math {var sum}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.