# Table decimal group count

`table-decimal-group-count` · version 1.0.0 · CSV & tables · free, no key needed

Count rows by exact string-valued dimensions with stable, bounded grouping output.

**Use when you need to: count decimal table by dimensions · grouped count for json rows · exact decimal count table.**

## Decide before calling

Read the [versioned contract](/v1/tools/table-decimal-group-count/versions/1.0.0) and the supported scope below. Reuse `table-decimal-group-count@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `table-decimal-group-count@1.0.0` for count decimal table by dimensions. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- count decimal table by dimensions
- grouped count for json rows
- exact decimal count table
- sql count over table
- bounded grouped count
- deterministic count groups

## Not supported

- parse CSV text
- floating-point measures
- more than six dimensions

## Behavior

- Dimensions are compared as exact well-formed strings; missing and null are the same data-null group.
- Generated subtotal cells use subtotal true, while data null cells use subtotal false.
- Grouping sets are emitted in structural order; within each set null sorts before strings and strings sort by Unicode code point.
- Decimal addition is exact and output is canonical base 10 without exponent or negative zero.
- The output is capped at 50000 group rows and 16777216 UTF-8 bytes.

## Input

- `rows` (array of object, required): max items 10000
- `dimensions` (array of string, required): min items 1; max items 6; each min length 1; each max length 64

## Output

- `standard_version` (constant "ISO/IEC 9075-2:2016", required)
- `groups` (array of object, required): max items 50000

## Limits

- max input bytes: 16777216
- max rows: 10000
- max dimensions: 6
- max columns per row: 16
- max field bytes: 64
- max decimal bytes: 256
- max output rows: 50000
- max output bytes: 16777216

## Example

Request input:

```json
{
  "rows": [
    {
      "region": "east"
    },
    {
      "region": "east"
    }
  ],
  "dimensions": [
    "region"
  ]
}
```

Response:

```json
{
  "result": {
    "standard_version": "ISO/IEC 9075-2:2016",
    "groups": [
      {
        "dimensions": [
          {
            "value": "east",
            "subtotal": false
          }
        ],
        "count": 2
      }
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "table-decimal-group-count",
  "version": "1.0.0",
  "input": {
    "rows": [
      {
        "region": "east"
      },
      {
        "region": "east"
      }
    ],
    "dimensions": [
      "region"
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/table-decimal-group-count/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"rows":[{"region":"east"},{"region":"east"}],"dimensions":["region"]}'
```

The machine-readable contract is at [/v1/tools/table-decimal-group-count/versions/1.0.0](/v1/tools/table-decimal-group-count/versions/1.0.0).

### CLI

```sh
node cli.mjs run table-decimal-group-count 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Table decimal group cube](/tools/table-decimal-group-cube): Sum exact decimal strings over deterministic SQL CUBE grouping sets with explicit subtotal markers.
- [Table decimal group rollup](/tools/table-decimal-group-rollup): Sum exact decimal strings over deterministic SQL ROLLUP grouping sets with explicit subtotal markers.
- [Table aggregate check](/tools/table-aggregate-check): Check claimed COUNT/SUM/AVG/MIN/MAX results over JSON rows exactly (SQL nulls); returns the first mismatch.
- [Table decimal group average](/tools/table-decimal-group-average): Group table rows by string keys and compute exact decimal average results with deterministic ordering.
- [Table decimal group extrema](/tools/table-decimal-group-extrema): Group table rows by string keys and compute exact decimal extrema results with deterministic ordering.
- [Table decimal group sum](/tools/table-decimal-group-sum): Group table rows by string keys and compute exact decimal sum results with deterministic ordering.
