Skip to content

Common errors and formula tips ​

Errors you can meet while you build charts, and the fix for each.

"Too many rows: the chart cannot be rendered" ​

Cause. product_metrics is SKU × day data, millions of rows. A chart that reads it un-aggregated (a table with sku, child_asin or parent_asin as a dimension, or a chart left on "all available dates") exceeds the BI tool's render limit.

Fix. Aggregate in SQL before the data reaches the chart. The most reliable way is a Custom Query with GROUP BY (Looker Studio), with a date-range filter. It is the pattern of the guidelines: pre-aggregate, pull and store.

"Cannot convert NULL value to non-Nullable type" (Code 349) ​

Cause. last_order_updated_date used as the date dimension. It is empty on the rows with no orders (traffic, ads, BSR only), and a NULL date breaks a time axis.

Fix. Use metric_date as the date dimension and the date-range dimension. Read last_order_updated_date only as MAX(last_order_updated_date): the "data as-of" timestamp.

"There is no supertype for types Decimal, Float64" (Code 386) ​

Cause. A calculated field mixes a plain integer with the floating-point metric values: CASE WHEN units = 0 THEN 0 ELSE product_sales / units END. A bare integer is read as a fixed-decimal type, and clashes with the float values.

Fix. Write every numeric constant with a decimal point: 0.0, 30.0, not 0, 30.

CASE WHEN units = 0 THEN 0.0 ELSE product_sales / units END

Average selling price

A weighted SUM(product_sales) / SUM(units) is more meaningful than an average of per-row prices. Guard it with THEN NULL, so an empty period stays blank rather than 0.