Download for MacApple silicon, macOS 14+
Skill

iterating-with-previous-and-cycles

@gopigment Updated 2026-10-23

Execution skill. Use when writing PREVIOUS, PREVIOUSOF, or PREVIOUSBASE formulas, configuring iterative calculation cycles, or debugging circular dependency errors.

Install

With your agent

Install OMGSkills skill "gopigment/ai-plugins:skills/iterating-with-previous-and-cycles" into this agent's normal skills directory: call the OMGSkills MCP get_install_plan tool for your agent and run the script it returns (it installs only the pinned commit and verifies SKILL.md), and stop if MCP or the pin is unavailable. Do not overwrite or change existing skills without asking me.

Manual command

git clone https://github.com/gopigment/ai-plugins /tmp/ai-plugins && ln -s /tmp/ai-plugins/skills/iterating-with-previous-and-cycles ~/.claude/skills/iterating-with-previous-and-cycles

From README

Iterating with PREVIOUS and Cycles Iterative calculations let a metric reference its own previous value along a dimension (typically time). Use them only for true metric-level circular dependencies; Pigment does not support cell-level circulars like Excel. Choose the Right Iterative Tool | Scope | Function | When to use | | --- | --- | --- | | Single block | PREVIOUS(Dimension [, Offset]) | All circular-referencing formulas are in one block | | Multiple blocks | PREVIOUSOF(Metric) | Circular references span different blocks; requires an iterative calculation cycle | Rule: loop within a single metric with PREVIOUS; loop across multiple metrics with PREVIOUSOF. PREVIOUSBASE is deprecated; use PREVIOUSOF instead. Write PREVIOUS Formulas Syntax: PREVIOUS(IteratingDimension [, Offset]) The argument is the iterating dimension, not the metric. Offset defaults to 1; can be a positive integer or an Integer metric on the same dimensions.