> For the complete documentation index, see [llms.txt](https://www.boxhero.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.boxhero.io/docs/documentation/zh/qi-ta-gong-neng/analytics.md).

# 库存报告

<figure><img src="/files/80ca7da445c2825d6fabd646b870ee7fb0e60e68" alt=""><figcaption></figcaption></figure>

***

## 库存报表概览

在侧边栏中，前往 <mark style="color:蓝色;">**`报表`**</mark> > <mark style="color:蓝色;">**`库存`**</mark>.

您可以调整公式设置来分析您的库存数据，按位置或日期范围筛选结果，并将报表导出到 Excel 以便记录和分析。

<figure><img src="/files/78bc0d8b5ad522ae40398c8aa3f890b6c9d4879d" alt=""><figcaption></figcaption></figure>

### A. 快速添加

快速添加我们预定义的常用公式，并生成有洞察力的报表。

{% embed url="<https://customer-0jrbilsa8yt3k758.cloudflarestream.com/75a44bd8bef54f0eaffffe6c74fc86e7/iframe?autoplay=true&controls=false&letterboxColor=transparent&loop=true&muted=true&poster=https://customer-0jrbilsa8yt3k758.cloudflarestream.com/75a44bd8bef54f0eaffffe6c74fc86e7/thumbnails/thumbnail.jpg?height=1080&preload=true>" %}

#### 商品属性

您可以使用 [属性](/docs/documentation/zh/gai-nian/attributes.md) 和数值创建公式。

#### 销售与利润

* **采购总金额**：成本 × 总入库数量
* **销售总金额**：单价 × 总出库数量
* **净利润**：单价 - 成本
* **毛利润**：（单价 - 成本）× 总出库数量
* **利润率**：（单价 - 成本）÷ 单价
* **日均利润**：（单价 × 总出库数量）÷ 天数
* **日均毛利润**：（单价 - 成本）× 总出库数量 ÷ 天数

#### **库存与流动**

* **库存价值**：成本 × 当前数量
* **库存周转率**：总出库数量 ÷ 周期内平均数量
* **日均入库**：总入库数量 ÷ 天数
* **日均出库**：总出库数量 ÷ 天数
* **补货状态**：if(当前数量 < 安全库存, "需要补货", "-")
* **预计缺货天数**：当前数量 ÷（总出库数量 ÷ 天数）

<figure><img src="/files/b1f377aacc3e66a31b8533ca95386f4e772216f9" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
更新商品成本或价格时，请注意 <mark style="color:蓝色;">**`报表`**</mark> 计算使用的是 *当前* 值。若要保持历史准确性，请考虑使用 <mark style="color:蓝色;">**`采购与销售`**</mark> 功能，或定期导出数据。
{% endhint %}

### B. 自定义公式

使用 BoxHero 的变量和函数创建符合您需求的独特公式。

<figure><img src="/files/6b76936fb8295914311a7ab970a58019bac735dc" alt=""><figcaption></figcaption></figure>

#### 自动补全变量

输入 `$` 以访问库存变量，并 `{{` 以检索已保存的属性/值。

<table><thead><tr><th width="209">变量名</th><th>描述</th></tr></thead><tbody><tr><td><strong>当前数量</strong></td><td>商品的当前库存水平。</td></tr><tr><td><strong>天数</strong></td><td>分析周期内的天数。</td></tr><tr><td><strong>周期内平均数量</strong></td><td>分析周期内的平均库存，按每天 23:59:59 的库存数量计算。</td></tr><tr><td><strong>周期初始数量</strong></td><td>分析周期开始时的库存（即 <em>起始日期前一天</em> 的 23:59:59，针对所选周期）。</td></tr><tr><td><strong>周期最终数量</strong></td><td>分析周期结束时的库存（即 <em>最后一天</em> 的 23:59:59）。</td></tr><tr><td><strong>总入库数量</strong></td><td>总入库数量。</td></tr><tr><td><strong>入库次数</strong></td><td>在特定期间内发生入库交易的次数。</td></tr><tr><td><strong>总出库数量</strong></td><td>总出库数量。</td></tr><tr><td><strong>加权出库平均值（线性：2、3、4）</strong></td><td><p>计算每日出库数量的加权平均值，更重视 <em>最近的</em> 数据。所选期间内的每一天都会获得一个权重，且权重每天线性递增。每日出库数量乘以各自权重后，再将这些加权数量之和除以权重之和。线性加权包含三种选项：</p><ul><li>线性权重 2：最早的一天权重为 1，最近的一天权重为 2</li><li>线性权重 3：最早的一天权重为 1，最近的一天权重为 3</li><li>线性权重 4：最早的一天权重为 1，最近的一天权重为 4</li></ul></td></tr><tr><td><strong>出库次数</strong></td><td>在特定期间内发生出库交易的次数。</td></tr><tr><td><strong>调整带来的数量变动</strong></td><td>使用以下功能导致的库存数量差异： <strong>调整</strong> 菜单（即增加数量 - 减少数量）</td></tr><tr><td><strong>调整减少数量</strong></td><td>使用以下功能导致的数量减少： <strong>调整</strong> 菜单。</td></tr><tr><td><strong>调整增加数量</strong></td><td>使用以下功能导致的数量增加： <strong>调整</strong> 菜单。</td></tr><tr><td><strong>调整次数</strong></td><td>某项 <strong>调整</strong> 交易在特定期间内发生的次数。</td></tr><tr><td><strong>调拨带来的数量变动</strong></td><td>使用以下功能导致的库存数量差异： <strong>调拨</strong> 菜单（即增加数量 - 减少数量）</td></tr><tr><td><strong>调拨减少数量</strong></td><td>通过使用以下功能导致的数量减少： <strong>调拨</strong> 菜单。</td></tr><tr><td><strong>调拨增加数量</strong></td><td>通过使用以下功能导致的数量增加： <strong>调拨</strong> 菜单。</td></tr><tr><td><strong>调出次数</strong></td><td>某项 <strong>调拨</strong> 交易被执行以降低整体库存水平的次数。</td></tr><tr><td><strong>调入次数</strong></td><td>某项 <strong>调拨</strong> 交易被执行以提高整体库存水平的次数。</td></tr></tbody></table>

{% hint style="success" %}
**小贴士**：使用 *加权平均值* 进行更细致的趋势分析，并 *组合公式* 通过将函数与变量嵌套来创建复杂指标。
{% endhint %}

#### 可用函数

BoxHero 支持多种类似 Excel 的函数，用于创建自定义公式。

* **基本算术：** `+`, `-`, `*`, `/`
* **条件**: `if(condition, value_if_true, value_if_false)`
* **四舍五入：**
  * **round**: `round(number, decimal_places)`
  * **roundUp**: `roundUp(number, decimal_places)`
  * **roundDown**: `roundDown(number, decimal_places)`
* **类型转换：**
  * **toNumber**: `toNumber(string, fallback_number)`
    * 要转换为数值的字符串，转换失败时显示的数字
  * **toString**: `toString(number)`
    * 要转换为字符串的数字

<figure><img src="/files/1a1765d604ddf8ff7e824da66591652bea64b049" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
不可在以下位置使用的变量和函数 <mark style="color:蓝色;">**`库存报表`**</mark> 可用于 [自定义分析](/docs/documentation/zh/qi-ta-gong-neng/custom-analytics.md).
{% endhint %}

***

## 常见问题

**想了解更多信息？** 浏览我们的常见问题解答：

{% content-ref url="/spaces/1XHeAQmLMHSILvJsICC2/pages/09711a2dd20371af45d2338abeec7519509cff49" %}
[库存报表](/docs/faq/zh/bao-biao/ku-cun-bao-biao.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.boxhero.io/docs/documentation/zh/qi-ta-gong-neng/analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
