apex_add_stat_delta
Add a stat card with a metric's current value, delta vs previous period, and trend arrow to highlight performance changes.
Instructions
Add a stat card with current value, delta, and trend arrow (up/down).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| columns | No | Number of columns (2-4). | |
| metrics | Yes | List of metric dicts: - "label": Card title - "sql": SQL returning current scalar value - "prev_sql": SQL returning previous-period value (for delta) - "icon": Font Awesome class (e.g., "fa-users") - "color": Accent color - "suffix": Unit suffix ("%", " pacientes", etc.) - "prefix": Unit prefix ("R$ ", "$", etc.) | |
| page_id | Yes | Target page ID. | |
| sequence | No | Display order on page. | |
| custom_css | No | Additional CSS rules injected into the style block. | |
| delta_label | No | Label text after the percentage change (default "vs anterior"). | vs anterior |
| region_name | Yes | Internal region name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |