---
title: "Discussion on \"Natural-Language Calculations in APEX 26.2\" | Hashnode"
description: "Discussion on \"Natural-Language Calculations in APEX 26.2\". Testing APEX 26.2 AI report calculations: gross profit, margin percentages, divide-by-zero handling, grouping, and when to use SQL."
url: "https://hashnode.com/posts/natural-language-calculations-in-apex-26-2/6af5ebb1987f32cbcb5a52b6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Natural-Language Calculations in APEX 26.2](https://blog.cloudnueva.com/natural-language-calculations-in-apex-26-2?utm_source=hashnode&utm_medium=feed)

Testing APEX 26.2 AI report calculations: gross profit, margin percentages, divide-by-zero handling, grouping, and when to use SQL.

11h ago · 8 min read · blog.cloudnueva.com  
Read the article

-   [#orclapex](https://hashnode.com/tag/orclapex)

## Written by

[Jon Dixon](https://hashnode.com/@orclapex)

@orclapex · San Diego, CA

  
[View profile](https://hashnode.com/@orclapex)

APEX, ORDS & the Oracle Database

I’m Jon Dixon, an Oracle APEX developer and consultant at Cloud Nueva. I write about APEX, ORDS, the Oracle Database, and how AI is changing the way we build software. This blog is where I share practical examples, lessons learned, and ideas from my work.

## Responses 1

Markdown supported · ⌘↵ to post

[OneLifeVibe](https://hashnode.com/@onelifevibe)

[1h ago](https://hashnode.com/posts/natural-language-calculations-in-apex-26-2/6af5ebb1987f32cbcb5a52b6/comment/6af675188e0395cb3d77b4ec)

The divide-by-zero test is the part that stuck with me. The first prompt produced a correct-looking margin, then a single zero-revenue row took the whole report down with ORA-01476, which is exactly the kind of failure that only shows up in real data. Putting the guard in Report Context instead of relying on every user to phrase the prompt correctly feels like the right call, since the CASE WHEN F=0 THEN NULL version also makes the intent explicit: a zero-revenue margin is undefined, not zero. I also liked the discipline in the conclusion: use the natural-language calculation to explore, then lock the agreed definition into SQL or a view once the team has settled what margin means. Did the Luna model ever suggest a different fallback, such as returning 0 instead of NULL, or was NULL its consistent choice across your runs?
