What is granularity or grain in data?

Granularity, or grain, is the level of detail that one row of data represents, for example one transaction, one day, or one customer per month. Fine granularity means highly detailed rows; coarse granularity means aggregated summaries. Getting the grain right is essential to correct analysis.

The grain of a table is the single most important thing to know about it: what does one row mean? A sales table might be one row per order line (fine grain), per order, or per day (coarse grain). Confusing grains leads to wrong numbers, summing a daily-summary table as if it were transaction-level will double-count.

Grain matters because:

  • Aggregation depends on it you can roll up from fine to coarse, but not invent detail you never stored.
  • Joins depend on it joining two tables at different grains can multiply rows.
  • Metrics depend on it an average at the wrong grain is meaningless.

iDBQuery is careful about grain when it answers. From your schema it understands what each table's rows represent, and it constructs aggregations and joins at the correct level so results are not double-counted or under-counted. When you ask a plain-language question, it resolves the grain for you and, by citing the answer back to source rows, lets you confirm the number was computed at the level you meant, protecting you from one of analytics' most common and costly mistakes.

Updated 2026-06-22