---
document_id: agent.dataset.tmall.task.brand_share
schema_version: 1
---

<!-- Generated by scripts.build_agent_guide; do not edit. -->

# Brand share / 品牌份额

Compute a brand's share from two atomic GMV results returned by one bundled call.

通过一次组合调用返回的两个原子销售额结果计算品牌份额。

## Required inputs / 必要输入

- `brand` — `search_values`; required (`brand`): Exact brand value
  精确品牌值
- `scope` — `search_values`; required (`category_l3`): Exact category scope
  精确品类范围
- `time` — `user_required`; required: Analysis time range
  分析时间范围

## Steps / 步骤

1. `resolve_values` · `search_values` — Resolve brand and category values.
   对齐品牌和品类值。
   - search `brand` with `${brand}`, `category_l3` with `${scope}`
2. `query_brand` · `query_metrics` — Query brand GMV in the selected scope.
   查询所选范围内的品牌销售额。
   - bundle: `share_inputs` (one `query_metrics` call)
   - metrics: `gmv`
   - filters: `brand eq ${brand}`, `category_l3 eq ${scope}`
   - time: `${time}`
3. `query_scope` · `query_metrics` — Query total GMV in the same scope.
   查询相同范围内的总销售额。
   - bundle: `share_inputs` (one `query_metrics` call)
   - metrics: `gmv`
   - filters: `category_l3 eq ${scope}`
   - time: `${time}`

## Agent computation / Agent 计算

- `compute_share` · `ratio` from `query_brand`, `query_scope` — Divide brand GMV by total scope GMV.
  用品牌销售额除以范围总销售额。

## Output requirements / 输出要求

- Show numerator, denominator, and percentage.
  展示分子、分母和百分比。

## Limitations / 限制

- The numerator and denominator must use identical time and scope.
  分子与分母必须使用相同时间和范围。

## Stop conditions / 停止条件

- Stop if the denominator is zero or values are ambiguous.
  分母为零或取值有歧义时停止。
