> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/chinese/guan-li-yu-she-zhi/workflow/cards-overview/then/table/calculate-in.md).

# 在表格中计算

<figure><img src="https://1870485400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlPczlNw8zzYNLfjfispX%2Fuploads%2Fgit-blob-9386ae95e96e0757706aca4f5e05db2d00ecade9%2Fimage%20(371).png?alt=media" alt="" width="563"><figcaption></figcaption></figure>

## **用途：**

\*\*“使用正则表达式依赖项进行计算”（Calculate with Regex Dependency）\*\*工作流卡片允许用户对所选表格中的列进行计算，并根据应用于依赖列的正则表达式（regex）模式添加条件。如果模式匹配，则执行计算，并将结果存储在指定的结果列中。

## **卡片组件：**

1. **表格名称**
   * **说明：指定要对其中的列进行计算的表格**。
   * **详情：提供所有可用表格**的下拉列表供用户选择。
2. **列名称（第 1 列）**
   * **说明：指定参与计算的第一列**。
   * **详情：提供所有可用列**的列表供用户选择。
3. **运算**
   * \*\*说明：\*\*定义所选列之间要执行的数学运算。
   * **选项：**
     * \*\*加法 (+)：\*\*将第二列的值加到第一列的值上。
     * \*\*减法 (-)：\*\*用第一列的值减去第二列的值。
     * \*\*乘法 (\*)：\*\*将第一列的值乘以第二列的值。
     * \*\*除法 (/)：\*\*用第一列的值除以第二列的值。
4. **列名称（第 2 列）**
   * **说明：指定参与计算的第二列**。
   * **详情：提供所有可用列**的列表供用户选择。
5. **列名称（依赖项）**
   * **说明：指定要应用正则表达式模式的依赖列**。
   * **详情：提供所有可用列**的列表供用户进行模式匹配。
6. **正则表达式模式**
   * **说明：定义用于匹配依赖列的正则表达式模式**。
   * \*\*详情：\*\*如果依赖列中的值与正则表达式模式匹配，则执行计算。
7. **结果列**
   * **说明：指定用于存储计算结果的结果列**。
   * \*\*详情：\*\*可以选择新列或现有列来存储计算值。

## **功能：**

* **条件评估：**
  * 只有当\*\*“Where”**和**“And Sections”\*\*的评估结果均为 true 时，该卡片才会执行其操作。
  * 只有当依赖列中的值与提供的**正则表达式模式**匹配时，该卡片才会执行其操作。
* **列计算：**\
  如果正则表达式模式匹配，该卡片会对所选的两列执行所选数学运算。
* **存储结果：**\
  计算结果会存储在所选的**结果列**中。

## **设置与配置：**

* **选择表格：**\
  选择要对其中的列进行计算的**表格**。
* **选择列：**\
  选择用于计算的**第一列**和**第二列**。
* **选择运算：**\
  选择要在两列之间执行的数学运算（**加法 (+)**、**减法 (-)**、**乘法 (\*)**、**除法 (/)**）。
* **选择依赖列：**\
  选择要应用正则表达式模式的**依赖列**。
* **定义正则表达式模式：**\
  输入依赖列应匹配的**正则表达式模式**。
* **选择结果列：**\
  选择用于存储计算值的**结果列**。

## **总结：**

\*\*“使用正则表达式依赖项进行计算”（Calculate with Regex Dependency）\*\*工作流卡片提供了一种基于正则表达式模式条件进行计算的强大方式。这样，只有依赖列与指定模式匹配的行才会执行相应计算，并将结果存储在所选结果列中。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/chinese/guan-li-yu-she-zhi/workflow/cards-overview/then/table/calculate-in.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
