derive
Compute net totals across transaction types in a single call by summing signed sums of a quantity column, with per-component breakdown and warnings for unmatched conditions.
Instructions
Computes a NET value over transaction types in one call: sum of sign * groupwise_sum(quantity_col) across the given components. This is how a stock figure like receipts + purchases − consumption − returns becomes ONE call with the arithmetic done in pandas, instead of five filter_sheet calls added up in your head (which RULE 3 forbids).
components is a list of {"conditions": {...same grammar as filter_sheet...}, "sign": 1 or -1, "label": "receipts"} conditions (optional) pre-filters the sheet before any component applies. The response includes a per-component breakdown with rows_matched. A component that matched ZERO rows is flagged and warned about — check the spelling of the transaction type before trusting the net.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sheet | Yes | ||
| group_by | Yes | ||
| file_name | Yes | ||
| components | Yes | ||
| conditions | No | ||
| folder_path | No | ||
| quantity_col | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||