Fix saved search formula error: Possible divide b...
# ask-stanley-ai
l
Fix saved search formula error: Possible divide by zero
c
AI generated answer (using internal Slack threads):
****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The error you're encountering is likely due to a division by zero in your saved search formula. This can occur when the denominator in your formula,
{netamountnotax}
in this case, is either zero or null. To fix this, you can use the
NULLIF
and
NVL
functions in your formula to handle these cases. The
NULLIF
function returns null if both expressions are equal, and the
NVL
function returns 1 if the first expression is null. Here's how you can modify your formula:
Copy code
{taxtotal} / NVL( NULLIF( {netamountnotax} , 0), 1)
This formula will return null if
{netamountnotax}
is zero, and 1 if it's null, thus avoiding a divide by zero error.
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.847961426
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.846801758
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.845275879
Please provide your feedback on this answer.