Hey there! Question regarding Metrics & MAQL: ...
# gooddata-platform
p
Hey there! Question regarding Metrics & MAQL: How do you handle DivisionZeroError? In Standard SQL (BigQuery), there is the
SAFE_DIVIDE
function, but in MAQL I couldn't find anything similar. Do you have an equivalent or do you automatically safe divide?
m
Hey Philippe, good question. In MAQL you do not need to worry about division by zero error. It will automatically return NULL in that case so the / operator behaves similar to SAFE_DIVIDE in BQ. BTW MAQL behaves this way also in other similar cases such as square root of any negative number.
p
Hey Michal! Thanks for the answer 🙂 Great to know!