Dashboard Metric State Automation: Zero Answered Three Different Questions At Once

A zero on a dashboard is not automatically the same fact as an absence of data
A summary tile reading "R$ 0,00" carries an implicit claim: that a real measurement was taken, and the true result of that measurement happens to be zero. That claim is only true for one of several genuinely different underlying situations a dashboard can actually be in — a program that is running normally and genuinely has zero of a specific thing right now, a program that has never existed at all for this organization, and a query that failed to run and produced no real answer whatsoever. Collapsing all three into the identical visual output removes exactly the distinction a person looking at the dashboard needs, at the exact moment they need it most: deciding whether a program that shows no activity is healthy and simply new, or not actually running at all.
How the underlying problem shows up before you fix it
A dashboard tile displays a bare numeric value with no accompanying indication of whether that number represents a genuine measurement, a complete absence of underlying data, or a failed query.
A percentage-change or growth figure is computed by dividing a difference by a prior-period baseline value — and that baseline can legitimately be zero, which makes the division itself mathematically undefined, not merely small.
Rather than reporting the calculation as impossible under a zero baseline, the code substitutes a fixed, arbitrary placeholder value (in this case, a flat "100") whenever the current period has any activity and the prior period has none — presenting an invented number with the same visual weight and formatting as a genuinely measured one.
A person viewing the dashboard has no way to distinguish "this organization's program is healthy and simply has zero redemptions today" from "no program has ever actually run here" from "the underlying query silently failed" — all three collapse into the identical zero.
A summary computation reads every matching row from a table for a time window with no row limit applied, and performs the aggregation itself in application code on the server rather than inside the database — a workable approach for a small dataset that becomes a real cost (the entire relevant history pulled into server memory on every single page load) as an organization's genuine transaction volume grows.
Why a summary number and an honest state are two different things a display needs
A running total or a count is a genuinely useful thing to compute and display, and the most direct way to display it is simply to show the number. The gap opens specifically at the boundary where that number CAN legitimately be zero for entirely different reasons — a healthy program with no current activity, versus no program existing at all — and where a derived figure, like a percentage change, depends on a baseline that can itself legitimately be zero or entirely absent. A display built to show only the resulting number, with no accompanying signal for WHY that number is what it is, cannot express the difference between "measured, and it's genuinely zero" and "there was nothing to measure" — and a growth calculation with no explicit guard for a zero or missing baseline will, by the ordinary rules of arithmetic, either fail outright or, if a developer patches around the failure with a placeholder value instead of an honest state, quietly start reporting a number that was never actually measured.
How Centriu Loop separated a genuine zero from an absence of anything to measure
Centriu Loop's own program-summary dashboard previously computed each of its tiles — available cashback, used cashback, total generated, customers with a balance, and a month-over-month growth percentage — by fetching the relevant rows directly and summing them as plain numbers, with the resulting figure displayed exactly as computed. This collapsed at least three genuinely different underlying situations into the identical visible zero: a program that is running with real historical activity but where the SPECIFIC total requested happens to be zero right now; an organization that has never had a single cashback movement recorded, ever; and a query that failed silently and returned nothing at all, treated by the display logic as indistinguishable from a genuine zero.
Separately, and independently, the growth-percentage tile computed `((recent - previous) / previous) * 100` whenever the prior 30-day period had any recorded activity — and, confirmed directly from the prior code's own logic, fell back to a hardcoded literal value of `100` whenever the prior period had zero activity but the current period had any activity at all. A percentage change computed against a genuinely zero baseline has no real mathematical answer — it is undefined, not one hundred — and presenting that placeholder with the identical visual styling and framing as a real, measured growth rate told a business owner their program had grown by exactly 100%, a figure with no actual basis in any real prior-period comparison.
The fix introduces an explicit, typed model with five distinct states for every metric the dashboard displays: genuinely measured (a real number, including a legitimate zero); no data, meaning the organization has never had any relevant activity at all; insufficient data, meaning some activity exists but not enough to support the SPECIFIC calculation being requested (the exact situation a zero-baseline growth calculation is now recognized to fall into); unavailable, meaning the measurement does not exist as a capability in the system today; and error, meaning a measurement was genuinely attempted and failed. Each state renders as its own honest, distinct piece of display text — a genuine zero shows as a real currency value, an organization with no program at all shows a dedicated "nothing launched yet" message instead of a grid of zeroed tiles, and the growth tile specifically now shows "no comparison baseline for the prior period" rather than any percentage figure whenever the prior period lacks real activity to compare against.
A related, smaller correction folded into the same fix: the underlying summary computation previously fetched every matching ledger row for a 30-day window with no limit applied, summing them in JavaScript on the application server — workable for a small dataset, but a genuine cost (the entire relevant transaction history pulled into server memory on every dashboard load) that grows directly with an organization's real activity. The aggregation itself was moved into a single dedicated database function, computing every summary figure directly inside PostgreSQL and returning only the already-summarized result to the application.
What is actually built today
Every metric on Centriu Loop's program dashboard carries an explicit state — genuinely measured, no data at all, insufficient data for this specific calculation, unavailable, or error — rather than being reduced to a bare number with no context.
An organization that has never had any cashback activity sees a dedicated, honest message explaining that numbers will appear after the first transaction, instead of a full grid of tiles all reading zero.
The month-over-month growth figure reports "no comparison baseline for the prior period" whenever the prior period lacks real activity to compare against, rather than fabricating a percentage with no genuine mathematical basis.
A redemption-rate figure is computed only when there is real cashback generated to divide against, avoiding the identical class of division-against-zero problem in a second, separate calculation on the same dashboard.
The dashboard's own summary totals are computed by a single dedicated database function rather than by fetching every matching row and summing them in application code — removing an unbounded, growing read from every single page load.
A brand-new store and an empty cash register (illustrative framing of the actual measured finding)
A store that joined Centriu Loop yesterday and a store that has run a healthy cashback program for a year but genuinely had zero redemptions today would, before the fix, see the identical dashboard: four tiles, all reading R$ 0,00. After the fix, the brand-new store instead sees a dedicated message explaining that numbers will appear after its first cashback transaction, while the established store sees its real, measured zero displayed as exactly that — a genuine, current result, not an absence mistaken for one.
What changes operationally
Centriu Loop's program dashboard now distinguishes a genuinely measured zero from an organization that has never had any cashback activity and from a query that failed — and its growth-percentage figure reports an honest "no comparison baseline" rather than a fabricated "+100%" whenever no real prior-period activity exists to compare against.
When this is not the right fit
This automation covers specifically how Centriu Loop's own program dashboard represents the state of a metric and computes a growth comparison. It is a distinct mechanism from this pillar's separate pages on Loop's cashback rounding calculation and its balance-update logic — related in that all three come from the same broader hardening effort, but each addressing a genuinely different, independent part of the system.
Displaying a raw number vs. displaying a typed, honest state
Computing a total and displaying it directly is the simplest possible design, and it is entirely adequate for as long as every possible result the calculation can produce means the same thing to whoever is reading it. It breaks down specifically when a bare number — most commonly zero — can legitimately mean several genuinely different things depending on context the number itself cannot carry. An explicit, typed state attached to every metric — distinguishing a real measurement from an absence of data, from insufficient data for one specific calculation, from a failure — costs more to build than displaying a raw number, but is the only version of the two that lets a person reading the dashboard trust that what they see reflects reality rather than a placeholder standing in for it.
Related systems
Main system: Centriu Loop.
What it does NOT do
- Does not change what Centriu Loop actually measures — every underlying total (available cashback, used cashback, total generated, customers with a balance) is computed exactly as before; the fix changes how the RESULT is represented when there is nothing genuine to report.
- Does not retroactively correct any growth percentage a business owner may have already seen displayed before this fix shipped — it changes how every NEW dashboard render computes and displays that figure going forward.
- Does not extend this same honesty model automatically to every other dashboard across Centriu's other systems — this fix is specific to Centriu Loop's own program-summary dashboard, confirmed to carry this exact set of gaps.
- Does not overlap with this pillar's separate pages on Loop's cashback rounding precision or balance-update atomicity — each covers a different, independent mechanism from the same broader hardening effort.
- Does not add a growth comparison where none can honestly exist — an organization with no real prior-period activity sees an explicit "no comparison baseline" message, never a manufactured percentage of any kind, including zero.
Security and governance
Centriu Loop's own program dashboard now distinguishes a genuinely measured value from an absence of data and from a failed measurement across every metric it displays, and reports an honest "no comparison baseline" rather than a fabricated growth percentage whenever no real prior-period activity exists. Any personal or financial data referenced in dashboard totals remains subject to Brazil's LGPD (Law No. 13,709/2018). Full detail on data handling lives at /governanca and /iso.
Pricing and contracting
Available by monthly subscription, with tiered plans. Values and terms come from the official pricing table at /precos (Centriu's central source — never restated here).
Frequently asked questions
Was the fabricated "+100%" growth figure ever shown to a real business owner?
The finding is confirmed directly from the prior code's own logic — a hardcoded fallback value that activated whenever the prior period had zero activity and the current period had any. Whether it was actually observed by a specific business owner in practice is a separate question this fix does not itself answer; the fix closes the mechanism regardless.
Why is a percentage change against a zero baseline undefined rather than just '100%'?
Because a percentage change is a ratio of the difference to the baseline value — dividing by zero has no real mathematical answer at all, which is different from the difference genuinely being one hundred percent of the baseline.
Does a genuinely zero value still show as "0" on the dashboard now?
Yes — a real, measured zero (an organization with an active program that simply has zero of a specific thing right now) displays as an honest zero. The fix specifically distinguishes THAT case from an organization with no program at all, which now shows a dedicated message instead.
What happens to the redemption-rate tile under the same fix?
It follows the identical principle: the rate is only computed when there is real cashback generated to divide against, reporting insufficient data otherwise, rather than presenting a zero-over-zero division as a meaningful percentage.
Is the unbounded-query fix here the same finding as other performance pages on this site?
It is the same general category of fix (moving an aggregation into the database rather than summing rows in application code) applied to this one specific dashboard computation — folded into this page because it was fixed alongside the same commit, not presented as a new, standalone mechanism.
What does Centriu Loop cost?
It is sold by subscription with a published starting price — exact current values are on the central pricing page.
See how Centriu Loop reports real program numbers, honestly
Reach our commercial team directly, or leave your details below — we'll follow up with guidance for your case.
