Skip to content

A Lobby element expression dividing two values (A/B) throws a divide-by-zero error whenever the denominator happens to be zero for a given row, for example on a site with no relevant activity yet. Is there a general way to avoid this error in a Lobby or Quick Report SQL expression?

Answer

Use A / NULLIF(B, 0) instead of a plain A/B division — NULLIF returns NULL when its two arguments are equal, so if the denominator is genuinely zero, the whole division evaluates to NULL rather than raising a divide-by-zero error, letting the row still display (with a blank/null result for that specific calculated column) instead of breaking the whole report or element.

← Browse Reporting and analytics questions