This allows users to analyze stock performance and detect when and how long inventory levels remained below a critical threshold for each agent or unit.


The kpi_Stock action calculates the duration of low-stock conditions across three different time periods of a day:
This allows users to analyze stock performance and detect when and how long inventory levels remained below a critical threshold for each agent or unit.
This version of the kpi_Stock action is not backward compatible with older versions. The main changes are:
StockBefore (stock before transaction)StockAfter (stock after transaction)StockAfter column have been adjusted to more accurately reflect post-transaction levels.The action calculates the low-stock duration in minutes based on a provided threshold, either fixed or per-record.
The input table must contain the following columns:
| Column Name | Description |
|---|---|
AgentID |
Unique identifier of the agent/unit |
StockBefore |
Stock level before the transaction |
StockAfter |
Stock level after the transaction |
LowStockThreshold |
Threshold value below which stock is considered low |
TransactionTime |
Time of transaction (format: hh:mm:ss) |
KPI_ComputationTime |
Time marking the end of the KPI evaluation window |
Before applying this action, the data must be sorted by
AgentID(alphabetical) andTransactionTime(chronologically).


To ensure proper KPI calculation, the input table must be sorted:
AgentID (alphabetical)TransactionTime (chronological)
The resulting output table includes the following columns:
| Output Column | Description |
|---|---|
Agent |
Agent ID copied from input |
Low Stock Duration on full day |
Total minutes stock was below threshold during the full day |
Low Stock Duration during day-light |
Minutes of low stock during the daylight period (07:00 - 22:00) |
Low Stock Duration during peak time |
Minutes of low stock during peak hours (16:00 - 20:00) |
KPI Computation time |
Cutoff time used for calculation (from input column KPI_ComputationTime) |

Scenario:
You manage stock levels across retail agents and want to measure how often each one falls below a safety threshold. Using this action, you can:

- Notes:
- Negative durations may indicate incorrect sorting or overlapping timestamps — ensure your input is chronologically ordered.
- If both fixed and dynamic thresholds are provided, the dynamic column takes precedence.
